Commit Graph

1727 Commits

Author SHA1 Message Date
Michal Mielewczyk
16830cd3c3 pyocf: rio: Fix the default JobSpec
Make JobSpec dataclass' default values immutable.

Signed-off-by: Michal Mielewczyk <michal.mielewczyk@huawei.com>
2024-08-29 08:29:10 +02:00
Robert Baldyga
8668ae9c37 pyocf: Fix test_io_propagation_multiple_subvolumes
Make sure end_offset is never generated as 0. Otherwise the last volume
in the range will not get any io, leading false negative test result.

Signed-off-by: Robert Baldyga <robert.baldyga@huawei.com>
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@huawei.com>
2024-08-29 08:28:13 +02:00
Michal Mielewczyk
1c7de189e2 Get rid of non-OCF error codes
Let's put an end to random crashes and vague error messages in pyocf!

Signed-off-by: Michal Mielewczyk <michal.mielewczyk@huawei.com>
2024-08-29 08:27:51 +02:00
Robert Baldyga
476573bffa
Merge pull request #803 from mmichal10/fix-cleaner-req-refcnt
Fix cleaner req refcnt
2024-08-27 17:02:21 +02:00
Michal Mielewczyk
d883a40dbc cleaner: refactor completion function
The completion function should be the same either when it is called from
the queue context or from currnet context

Signed-off-by: Michal Mielewczyk <michal.mielewczyk@huawei.com>
2024-08-27 15:20:02 +02:00
Michal Mielewczyk
736665af47 cleaner: Fix master request refcnt
Commit db6b009ef introduced changes in managing the master request life cycle,
but apparently not all paths have been updated. This change removes a redundant
ocf_req_get() before sending the requets into a queue

Signed-off-by: Michal Mielewczyk <michal.mielewczyk@huawei.com>
2024-08-27 07:44:09 +02:00
Michał Mielewczyk
63f4a373ec
Merge pull request #802 from mmichal10/fix-cleaner-refcnt
cleaner: Fix tracking in-flight cache requests
2024-08-20 13:02:27 +02:00
Michal Mielewczyk
312b32ad61 cleaner: Fix tracking in-flight cache requests
When flushing a request, the number of cache reads is unknown until all cache
lines are locked and the IOs are actually submitted.

Signed-off-by: Michal Mielewczyk <michal.mielewczyk@huawei.com>
2024-08-19 22:10:45 +02:00
Robert Baldyga
5b2f26decf
Merge pull request #800 from robertbaldyga/redesign-queue-api
Redesign queue API
2024-08-02 14:43:52 +02:00
Ian Levine
ac1b6b774a Added a priority queue for the request instead of push front
Now the request can be pushed to a high priority queue (instead of ocf_queue_push_req_front)
and to a low priority queue (instead of ocf_queue_push_req_back).
Both functions were merged into one function (ocf_queue_push_req) and instead of the
allow_sync parameter there is now a flags parameter that can be an OR combination of
OCF_QUEUE_ALLOW_SYNC and OCF_QUEUE_PRIO_HIGH

Signed-off-by: Ian Levine <ian.levine@huawei.com>
Signed-off-by: Robert Baldyga <robert.baldyga@huawei.com>
2024-08-02 12:53:16 +02:00
Ian Levine
4f2d5c22d6 Move and rename ocf_engine_pop_req from cache_engine to ocf_queue_pop_req in ocf_queue
Signed-off-by: Ian Levine <ian.levine@huawei.com>
Signed-off-by: Robert Baldyga <robert.baldyga@huawei.com>
2024-08-02 12:53:16 +02:00
Ian Levine
038126e9ab Move and rename ocf_engine_push_req_* from engine_common to ocf_queue_push_req_* in ocf_queue
Signed-off-by: Ian Levine <ian.levine@huawei.com>
Signed-off-by: Robert Baldyga <robert.baldyga@huawei.com>
2024-08-02 12:53:16 +02:00
Ian Levine
de32a9649a Rename ocf_engine_cb to ocf_req_cb and move it from engine_common.h to ocf_request.h
Signed-off-by: Ian Levine <ian.levine@huawei.com>
Signed-off-by: Robert Baldyga <robert.baldyga@huawei.com>
2024-08-02 12:53:10 +02:00
Robert Baldyga
40ff7d2dcf
Merge pull request #799 from Open-CAS/cache_detach
Implement cache detach/attach
2024-07-31 06:54:08 +02:00
Robert Baldyga
88e39b5827
Merge pull request #801 from robertbaldyga/revert-complete-queue
Revert "cleaner: Remove complete_queue"
2024-07-30 14:03:20 +02:00
Robert Baldyga
218e9c5723 Revert "cleaner: Remove complete_queue"
This functionality is used by cleaning policies via cmpl_queue
to reschedule the completion, so that we avoid unlocking mutex in
the cleaner completion from interrupt context of IO completion.

This reverts commit 1e5eda68a7.

Signed-off-by: Robert Baldyga <robert.baldyga@huawei.com>
2024-07-26 10:35:23 +02:00
Robert Baldyga
54679d7ff7
Merge pull request #797 from robertbaldyga/fixes-in-cleaner
Fixes in cleaner
2024-07-18 20:49:27 +02:00
Robert Baldyga
1e5eda68a7 cleaner: Remove complete_queue
Signed-off-by: Robert Baldyga <robert.baldyga@huawei.com>
2024-07-12 17:38:17 +02:00
Robert Baldyga
db6b009ef5 cleaner: Simplify master request life cycle management
Signed-off-by: Robert Baldyga <robert.baldyga@huawei.com>
2024-07-12 17:38:17 +02:00
Robert Baldyga
3300dbd4e7 cleaner: Rework request allocation
Signed-off-by: Robert Baldyga <robert.baldyga@huawei.com>
2024-07-12 17:38:17 +02:00
Robert Baldyga
3248c85828 cleaner: Skip cleaner iteration if the map is empty
Signed-off-by: Robert Baldyga <robert.baldyga@huawei.com>
2024-07-12 17:38:17 +02:00
Robert Baldyga
dfb2e1a8d5 cleaner: Check mapping after taking cache line lock
Signed-off-by: Robert Baldyga <robert.baldyga@huawei.com>
2024-07-12 17:38:13 +02:00
Robert Baldyga
0a13bea889 cleaner: Skip filling the tail of the request map
Simply update req->core_line_count instead.

Signed-off-by: Robert Baldyga <robert.baldyga@huawei.com>
2024-07-12 13:23:35 +02:00
Robert Baldyga
2b94a3ab31 cleaner: Move sort functionality to flush_data abstraction
The flush_data is used by ocf_cleaner_do_flush_data_async(), which means
that callers of ocf_cleaner_fire() are now expected to guarantee that
entries are returned by getter in a sorted order. Currently the only case
when ocf_cleaner_fire() is called directly is for request cleaning, and
the request map is sorted by definition.

Signed-off-by: Robert Baldyga <robert.baldyga@huawei.com>
2024-07-12 13:23:35 +02:00
Robert Baldyga
dd4add45e1 lru: Use common flush_data abstraction for cleaning
Signed-off-by: Robert Baldyga <robert.baldyga@huawei.com>
2024-07-12 13:23:35 +02:00
Robert Baldyga
43cc487c40 lru: Move partition runtime structures outside of metadata
Signed-off-by: Robert Baldyga <robert.baldyga@huawei.com>
2024-07-12 13:23:29 +02:00
Michal Mielewczyk
83ec255458 Disable changing cache params for detached cache
Majority of management operations should be blocked for detached cache,
although adding and removing cores should be possible.

Signed-off-by: Michal Mielewczyk <michal.mielewczyk@huawei.com>
2024-07-10 16:19:37 +02:00
Michal Mielewczyk
f1bfd94c98 Enable IO to detached cache instance
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@huawei.com>
2024-07-10 16:18:44 +02:00
Michal Mielewczyk
de07458ff2 Common context for cache stop and cache detach
Stop and cache detach were already sharing contexts implicitly, which allowed
to reuse some functions in both pipelines. However, changing the context structs
could lead to not obvious bugs.

To prevent such errors both methods now share context structure explicitly

Signed-off-by: Michal Mielewczyk <michal.mielewczyk@huawei.com>
2024-07-10 16:18:33 +02:00
Michal Mielewczyk
09335cd6f2 Update cache's state after detach
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@huawei.com>
2024-07-10 16:18:28 +02:00
Michal Mielewczyk
695d77e3b5 Apply cache state API
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@huawei.com>
2024-07-10 16:18:23 +02:00
Michal Mielewczyk
2f0b86f5ca Extend cache state API
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@huawei.com>
2024-07-10 16:18:17 +02:00
Michal Mielewczyk
047e07c062 Rename cache "initializing" state to "detached"
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@huawei.com>
2024-07-10 16:18:04 +02:00
Michal Mielewczyk
d3c11a983b Update cache state when stopping uninited instance
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@huawei.com>
2024-07-10 16:16:31 +02:00
Michal Mielewczyk
f8a0f88892 Test detaching cache twice
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@huawei.com>
2024-07-10 16:16:18 +02:00
Michal Mielewczyk
c95f396ba9 Test for attaching cache twice
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@huawei.com>
2024-07-10 16:15:34 +02:00
Michal Mielewczyk
58fddd3602 Test add and remove core with cache detached
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@huawei.com>
2024-07-10 16:15:18 +02:00
Michal Mielewczyk
3f41a35f30 Patch detached cache API
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@huawei.com>
2024-07-10 16:14:33 +02:00
Michal Mielewczyk
06a2125ba9 pytest: update random.seed() argument
From python3.11 the function accepts only NoneType, int, float, str, bytes, or
bytearray

Signed-off-by: Michal Mielewczyk <michal.mielewczyk@huawei.com>
2024-07-10 16:14:30 +02:00
Michal Mielewczyk
e557fd4f64 Fix comment
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@huawei.com>
2024-07-10 16:13:45 +02:00
Michal Mielewczyk
41224c61c0 Track max number of cores for atomic volume
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@huawei.com>
2024-07-10 16:13:15 +02:00
Michal Mielewczyk
2a97de8792 Detach finish: destroy stop pipeline before cmpl
'stop_pipeline' filed may be reused during cache lifetime (e.g. when cache is
detached and attached again - the pipeline would be freed and then
re-allocated). Calling completion after detach before freeing the pipeline may
lead to race condition.

Signed-off-by: Michal Mielewczyk <michal.mielewczyk@huawei.com>
2024-07-10 11:35:42 +02:00
Robert Baldyga
283a897eeb
Merge pull request #798 from robertbaldyga/mode-to-req-mode-conversions
Add missing ocf_cache_mode_t to ocf_req_cache_mode_t conversions
2024-07-08 09:12:01 +02:00
Robert Baldyga
d7fe7c05f1 Add missing ocf_cache_mode_t to ocf_req_cache_mode_t conversions
Signed-off-by: Robert Baldyga <robert.baldyga@huawei.com>
2024-07-05 16:59:05 +02:00
Robert Baldyga
ff0551b616
Merge pull request #796 from Open-CAS/fix_env_memset
Fix env memory zeroing
2024-06-13 17:35:58 +02:00
Rafal Stefanowski
5975bb8822 Fix env memory zeroing
Signed-off-by: Rafal Stefanowski <rafal.stefanowski@huawei.com>
2024-06-13 11:51:00 +02:00
Robert Baldyga
7c8ac29ab9
Merge pull request #793 from robertbaldyga/kernel-6.8
Minor fixes to clean compile with newer Linux kernels
2024-05-14 08:11:30 +02:00
Robert Baldyga
168ecd0075 Add missing "static" to the local function
Signed-off-by: Robert Baldyga <robert.baldyga@huawei.com>
2024-05-11 00:59:39 +02:00
Robert Baldyga
578f4b6591 Add missing headers
Signed-off-by: Robert Baldyga <robert.baldyga@huawei.com>
2024-05-11 00:51:29 +02:00
Robert Baldyga
43608fc812 Remove unused function
Signed-off-by: Robert Baldyga <robert.baldyga@huawei.com>
2024-05-11 00:50:34 +02:00