Commit Graph

736 Commits

Author SHA1 Message Date
Jan Musial
677e9e07e5 Allow 0ms activity threshold and wake up time for ALRU
Signed-off-by: Jan Musial <jan.musial@intel.com>
2020-02-21 16:05:20 +01:00
Adam Rutkowski
49d8f10953
Merge pull request #346 from robertbaldyga/fix-memory-alloc-in-metadata
Fix memory allocation in metadata
2020-02-14 13:21:05 +01:00
Robert Baldyga
ac7b5aba6b metadata: Allocate memory with ENV_MEM_NOIO flag
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2020-02-14 12:03:21 +01:00
Robert Baldyga
952767905a env: Add extended versions of env_vmalloc functions
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2020-02-14 12:03:21 +01:00
Robert Baldyga
b7e59ee04a metadata: Use proper function for freeing memory
a_req is allocated using env_vmalloc() so we need to free it
using env_vfree(), not env_free().

Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2020-02-14 10:29:15 +01:00
rafalste
1dfae0d166
Merge pull request #345 from arutk/resize_discard_alloc
Fix discard request map allocation
2020-02-10 16:12:17 +01:00
Adam Rutkowski
ee37391e97 Fix discard request map allocation
Discard handling splits large request into several steps.
However the actual size of request map for discard was
determined based on original request size, not step request
size, resulting in waste of memory and allocations > 4K.

Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2020-02-10 17:47:11 -05:00
Adam Rutkowski
26fd938ccf Reduce max trim request size to 512K
512K is the maximum request size for which request map
fits into one page (4K) regardless of cacheline size.

Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2020-02-10 15:57:34 -05:00
Adam Rutkowski
3eadffad0f Add static assert macro ENV_BUILD_BUG_ON to posix env
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2020-02-10 15:55:52 -05:00
Michał Wysoczański
fabd41250b
Merge pull request #342 from mmichal10/fix-metadata-flush
Fix metadata flush
2020-01-24 17:59:58 +01:00
Michal Mielewczyk
d9c987e068 Flush metadata after changing status of each sector
In case of cleaning metadata used to be flushed only when status of whole cache
line changed to clean.

This patch ensures that metadata flush is triggered after changin status of each
single sector is cache line.

Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2020-01-24 11:27:56 -05:00
Michal Mielewczyk
2f10365086 Flush metadata after setting dirty status of each sector.
After second dirty write to cache line which was already dirty, metadata flush
was not triggered. In case of dirty shutdown, this led to data corruption.

Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2020-01-24 11:27:56 -05:00
Michał Mielewczyk
30f884ba84
Merge pull request #343 from robertbaldyga/relax-memory-alloc-requirements-metadata-io
metadata: Relax memory allocation requirements
2020-01-24 11:37:31 +01:00
Robert Baldyga
7d82f20614 Remove unused include
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2020-01-24 11:21:04 +01:00
Robert Baldyga
4d25bbe4b3 metadata: Relax memory allocation requirements
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2020-01-24 11:21:04 +01:00
Sławomir Jankowski
89f0e96607
Merge pull request #339 from imjfckm/check-max-cache-size
Detect cache devices that would overflow ocf_cacheline_t
2020-01-22 10:25:16 +01:00
Jan Musial
e5aff609d9 Add test for huge cache
Signed-off-by: Jan Musial <jan.musial@intel.com>
2020-01-21 15:29:24 +01:00
Jan Musial
ecbb5cbc1b Make RAM infinite in POSIX env
Since the calculation that's being used right now isn't too acurate
anyways, let's just get rid of it, maybe we'll find more memory-related
bugs.

Signed-off-by: Jan Musial <jan.musial@intel.com>
2020-01-21 15:29:24 +01:00
Jan Musial
adc52ba71e Detect cache devices that would overflow ocf_cacheline_t
Signed-off-by: Jan Musial <jan.musial@intel.com>
2020-01-21 15:29:24 +01:00
Jan Musiał
5d1b5eafd6
Merge pull request #341 from robertbaldyga/make-discard-max-io-alligned-to-sector-size
discard: Make max_length aligned to sector size
2020-01-21 13:10:27 +01:00
Robert Baldyga
d1c2fc0c67 discard: Make max_length aligned to sector size
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2020-01-21 12:44:04 +01:00
Robert Baldyga
db2bdb01f3
Merge pull request #340 from micrakow/dbg_log_metadata
Moved setting ctx for temporary cache object before metadata init
2020-01-21 10:18:32 +01:00
Michal Rakowski
65756a8160 Moved setting ctx for temporary cache object before metadata init
This way debug prints during metadata init phase won't cause crash
(because of the fact that temporary cache object does not have proper
ctx set hence does not have logger obj).

Signed-off-by: Michal Rakowski <michal.rakowski@intel.com>
2020-01-16 21:53:40 +01:00
Robert Baldyga
ce28c71475
Merge pull request #326 from Ostrokrzew/upstream
Change error code
2020-01-10 13:38:18 +01:00
Sławomir Jankowski
b70dcf42d5
Merge pull request #338 from KamilLepek/codecov_followup
Codecov configuration
2020-01-10 09:59:27 +01:00
Kamil Lepek
8eee776b93 Added codecov.yml configuration file 2020-01-09 11:20:19 +01:00
Kamil Lepek
5828a7d0ae Added codecov badge to README, added coverage files to .gitignore 2020-01-09 10:54:59 +01:00
Jan Musiał
1784d6e3a2
Merge pull request #337 from micrakow/security_test_fixes
pyocf: fix security mngmt_start_fuzzy test
2020-01-08 15:18:39 +01:00
Michal Rakowski
bc866e5f9a pyocf: fix security mngmt_start_fuzzy test 2020-01-08 14:06:54 +01:00
Michal Rakowski
f2754ff06f
Merge pull request #335 from KamilLepek/codecov
Enable code coverage tracking in pyocf
2020-01-08 13:04:11 +01:00
Kamil Lepek
0d6660d4f3 Enable code coverage tracking in pyocf 2020-01-08 11:02:07 +01:00
Michał Mielewczyk
b58ebd4b88
Merge pull request #334 from imjfckm/fix-nhit-deadlock
Fix nhit deadlock
2020-01-02 10:58:59 +01:00
Ostrokrzew
3fca309e51 Change error code and add new
Change 'OCF_ERR_START_CACHE_FAIL' to 'OCF_ERR_NO_MEM' while CAS fails in case of memory lack on device.
Add new error code for case, when device doesn't satisfy CAS requirements - 'OCF_ERR_INVAL_CACHE_DEV'.
Use 'OCF_ERR_INVAL_CACHE_DEV' in code.
Update error code match in test.
closes #317 issue

Signed-off-by: Ostrokrzew <slawomir.jankowski@intel.com>
2020-01-02 09:34:24 +01:00
Jan Musial
5eca548e22 Make sure NHIT won't attempt to take the same semaphore twice
Signed-off-by: Jan Musial <jan.musial@intel.com>
2019-12-31 14:16:18 +01:00
Jan Musial
4536a51f59 Fix init of nhit + code styling
Signed-off-by: Jan Musial <jan.musial@intel.com>
2019-12-31 14:16:18 +01:00
Robert Baldyga
1ec0a5c053
Merge pull request #332 from mmichal10/stop-pipeline-in-cache
Keep stop pipeline in struct cache.
2019-12-30 17:15:42 +01:00
Michal Rakowski
28caa25b7a
Merge pull request #333 from arutk/fix_div_round_up
Change DIV_ROUND_UP to OCF_DIV_ROUND_UP
2019-12-30 08:23:08 +01:00
Adam Rutkowski
92b36c3484 Change DIV_ROUND_UP to OCF_DIV_ROUND_UP
This fixes compilation in SPDK env

Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2019-12-28 18:24:12 -05:00
Jan Musiał
9be9ca75d7
Merge pull request #331 from robertbaldyga/limit-metadata-reqs-v2
Limit number of concurrent io submitted by metadata_io_i_asynch()
2019-12-28 13:02:08 +01:00
Michal Mielewczyk
6ac3195823 Keep stop pipeline in struct cache.
To eliminate possibility of allocation error in cache stop, pipeline is
allocated on attach.

Due this change, the only possible non-zero status of  ocf_mngt_cache_stop() is
just a warning and cache is always stopped after executing it.

Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2019-12-27 18:54:15 -05:00
Robert Baldyga
d1249e5238 Limit number of concurrent io submitted by metadata_io_i_asynch()
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2019-12-19 16:50:41 +01:00
Michał Mielewczyk
3aa68bcb15
Merge pull request #330 from robertbaldyga/cleaner-retrieve-core-from-map
cleaner: Retrieve core object properly
2019-12-19 16:00:48 +01:00
Robert Baldyga
e06832426d cleaner: Retrieve core object properly
Cleaner doesn't set core object in req as it works in domain of cache
lines, which may belong to various cores. It this case should retrieve
core object not from the req, but from the map instead.

Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2019-12-19 14:44:04 +01:00
Michal Rakowski
a074026773
Merge pull request #329 from robertbaldyga/fix-cleaner-queue-change-before-put
Put a queue before calling cleaner completion callback
2019-12-19 11:33:27 +01:00
Robert Baldyga
32fd371583 Put a queue before calling cleaner completion callback
This ensures that cleaner queue will not be changed
by starting another cleaning iteration before we put it.

Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2019-12-18 20:49:56 +01:00
Robert Baldyga
4e5530851b
Merge pull request #327 from mmichal10/fix-hang-on-start
Revert "Limit number of concurrent io submitted by metadata_io_i_asyn…
2019-12-17 16:35:26 +01:00
Michal Mielewczyk
fb95f048fd Revert "Limit number of concurrent io submitted by metadata_io_i_asynch()"
Starting big caches hangs.

This reverts commit c2c9307b9b.

Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2019-12-17 10:29:44 -05:00
Michał Mielewczyk
6a753570b8
Merge pull request #325 from Ostrokrzew/upstream
Add reschedule to metadata hash init
2019-12-17 10:08:30 +01:00
Ostrokrzew
fc1847cf55 Add reschedule to metadata hash init
Signed-off-by: Ostrokrzew <slawomir.jankowski@intel.com>
2019-12-17 09:56:45 +01:00
Adam Rutkowski
57e6b96791
Merge pull request #323 from arutk/remove_fallthrough
Remove switch/case fallthrough
2019-12-12 11:49:08 +01:00