Commit Graph

1942 Commits

Author SHA1 Message Date
Robert Baldyga
08eb00665c
Merge pull request #854 from robertbaldyga/request-cleanup
A little cleanup between ocf_request and ocf_io
2025-02-04 15:20:44 +01:00
Robert Baldyga
c029f78e95 Make alock_rw a bit field
Signed-off-by: Robert Baldyga <robert.baldyga@huawei.com>
2025-02-04 12:05:26 +01:00
Robert Baldyga
0e294fc75d
Merge pull request #859 from Deixx/detach-unfreeze-fix
ocf_cleaner_refcnt_unfreeze bug fix
2025-02-04 11:40:14 +01:00
Daniel Madej
8ce129de06 ocf_cleaner_refcnt_unfreeze bug fix
During core remove/detach ocf_cleaner_refcnt_freeze was called only
when cache was attached, but ocf_cleaner_refcnt_unfreeze was called
regardless of cache state.

Signed-off-by: Daniel Madej <daniel.madej@huawei.com>
2025-01-15 18:51:42 +01:00
Robert Baldyga
e630b811ff
Merge pull request #858 from robertbaldyga/attach-fix-race-condition
Fix race condition during cache attach
2024-11-25 19:37:03 +01:00
Robert Baldyga
b850727d17 tests: Fix d2c test
Cache attach operation is not supposed to complete unless all the d2c
requests are completed, thus need to handle it asynchronously.

Signed-off-by: Robert Baldyga <robert.baldyga@huawei.com>
2024-11-21 21:29:23 +01:00
Robert Baldyga
0d06b3a597 Fix race condition during cache attach
After attaching new cache device handle all the IOs in Pass-Through mode
until all the d2c requests are completed.

Signed-off-by: Robert Baldyga <robert.baldyga@huawei.com>
2024-11-21 21:26:00 +01:00
Kamil Gierszewski
42004058cc
github-actions: add checkpatch
Signed-off-by: Kamil Gierszewski <kamil.gierszewski@huawei.com>
2024-11-05 12:55:49 +01:00
Robert Baldyga
2c28f33e37
Merge pull request #857 from robertbaldyga/fix-ubasn-false-positive-2
Avoid UBSAN false positive - continuation
2024-10-30 15:22:55 +01:00
Robert Baldyga
2da05343e2 Avoid UBSAN false positive - continuation
Address issue in two more instances.

Signed-off-by: Robert Baldyga <robert.baldyga@huawei.com>
2024-10-30 11:33:17 +01:00
Michal Mielewczyk
91ad6476e2 pyocf: Cache lines reclassification test
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@huawei.com>
2024-10-21 19:32:51 +02:00
Michal Mielewczyk
a18bee3d23 pyocf: ioclass statas api
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@huawei.com>
2024-10-21 19:32:51 +02:00
Michal Mielewczyk
6bfd2122d2 Repart all misclassified cache lines
Remapped cache lines my require repartitioning as well

Signed-off-by: Michal Mielewczyk <michal.mielewczyk@huawei.com>
2024-10-16 18:37:42 +02:00
Michal Mielewczyk
b3fa1fc96a Reset repart flag during refreshing request status
The flag isn't reset before retraversation so it might be true even if cache
line was reparted in the meantime

Signed-off-by: Michal Mielewczyk <michal.mielewczyk@huawei.com>
2024-10-16 18:37:42 +02:00
Robert Baldyga
b3332793bb Remove unused request field
Signed-off-by: Robert Baldyga <robert.baldyga@huawei.com>
2024-10-15 16:15:02 +02:00
Robert Baldyga
0cf4e8124b Remove io.ref_count
There is already refcounting on the request. No need for additional one.

Signed-off-by: Robert Baldyga <robert.baldyga@huawei.com>
2024-10-15 09:55:56 +02:00
Robert Baldyga
85513332d7 Remove ocf_io_get()
Signed-off-by: Robert Baldyga <robert.baldyga@huawei.com>
2024-10-15 09:55:56 +02:00
Robert Baldyga
a9718eeab1 Simplify fastpath handling
Signed-off-by: Robert Baldyga <robert.baldyga@huawei.com>
2024-10-15 09:55:56 +02:00
Robert Baldyga
1ab882aa61
Merge pull request #852 from robertbaldyga/forward_io-fix-error-accounting
Fix error accounting in forward_io
2024-10-15 08:44:47 +02:00
Robert Baldyga
e5a2042e0d
Merge pull request #847 from mmichal10/pre-refcnt-fixes
Refactors&fixes
2024-10-14 17:31:54 +02:00
Robert Baldyga
a1af1809d8 Fix error accounting in forward_io
Resetting cache_error/core_error in ocf_req_forward_* functions may lead
to overwriting already reported error if the forward is being done in the
loop.

To avoid this potential problem, introduce set of forward init functions
intended to be called before the entire forward operation, which resets
the error code and sets a forward callback.

Signed-off-by: Robert Baldyga <robert.baldyga@huawei.com>
2024-10-14 16:54:51 +02:00
Robert Baldyga
3959f58f1c Decrement core stats only if the cache line mapping is cleaned
We skip cleaning the mapping and moving the cache line to the free list
in a situation when there are waiters on the cache line lock.
Refrain from decrementing core stats in that situation as well, and let
repart of the waiter request do the updates as needed.

Signed-off-by: Robert Baldyga <robert.baldyga@huawei.com>
2024-10-14 13:28:56 +02:00
Michal Mielewczyk
1b2a9e03c3 Add missing cache unlock in init rollback
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@huawei.com>
2024-10-10 07:32:38 +02:00
Michal Mielewczyk
c82fd173c6 Remove redundant list_del(ctx->caches) during init
New caches are added to the list at the point where they are already
initialized and no errors are possible at this point, hence list_del() in error
handling is redundant.

Signed-off-by: Michal Mielewczyk <michal.mielewczyk@huawei.com>
2024-10-10 07:32:38 +02:00
Michal Mielewczyk
d22885ef7d example: Introduce error handling
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@huawei.com>
2024-10-10 07:32:38 +02:00
Michal Mielewczyk
e8e7a1600c Log errors on cache init
The more (logging) the merrier

Signed-off-by: Michal Mielewczyk <michal.mielewczyk@huawei.com>
2024-10-10 07:32:38 +02:00
Michal Mielewczyk
f6bdd354d0 Don't bug on cache init
Even if locking the new cache should never fail it's not an unrecoverable
state.

Signed-off-by: Michal Mielewczyk <michal.mielewczyk@huawei.com>
2024-10-08 11:14:20 +02:00
Roel Apfelbaum
1d1561649c Remove redundant fallback-PT counter accesses
The fewer (atomic variable accesses on IO path) the better fare

Signed-off-by: Roel Apfelbaum <roel.apfelbaum@huawei.com>
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@huawei.com>
2024-10-08 11:14:20 +02:00
Robert Baldyga
6f02a625ad pipeline: Introduce debug logging
Signed-off-by: Robert Baldyga <robert.baldyga@huawei.com>
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@huawei.com>
2024-10-08 11:14:20 +02:00
Michal Mielewczyk
40a850cd9c Remove dead code
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@huawei.com>
2024-10-08 11:14:20 +02:00
Michal Mielewczyk
0bb2621c50 Increment ctx.refcnt before creating a new cache
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@huawei.com>
2024-10-08 11:14:20 +02:00
Michal Mielewczyk
fae30462b1 Decrement cache.refcnt if locking cache failed
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@huawei.com>
2024-10-08 11:14:20 +02:00
Robert Baldyga
6ad1007e6f
Merge pull request #848 from robertbaldyga/maintainer-email
Update maintainer's email
2024-10-07 13:30:13 +02:00
Robert Baldyga
89d48a7d39 Update maintainer's email
Signed-off-by: Robert Baldyga <robert.baldyga@huawei.com>
2024-10-07 09:37:34 +02:00
Robert Baldyga
d166bb7938
Merge pull request #846 from mmichal10/flush-tests
Flush tests
2024-10-04 08:50:33 +02:00
Robert Baldyga
b16b49c84d tests: Introduce cache/core flush test
Signed-off-by: Robert Baldyga <robert.baldyga@huawei.com>
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@huawei.com>
2024-10-04 07:54:46 +02:00
Roel Apfelbaum
b8ea10f30c pyocf: Fix core.reset_stats()
Signed-off-by: Roel Apfelbaum <roel.apfelbaum@huawei.com>
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@huawei.com>
2024-10-04 07:52:14 +02:00
Robert Baldyga
f729887938
Merge pull request #845 from robertbaldyga/fix-ubsan-false-positive
Avoid UBSAN false positive
2024-10-02 16:58:42 +02:00
Robert Baldyga
75fb6a59e0 Avoid UBSAN false positive
UBSAN: array-index-out-of-bounds in src/ocf_request.c:230:44
index 1 is out of range for type 'ocf_map_info [*]'

Signed-off-by: Robert Baldyga <robert.baldyga@huawei.com>
2024-10-02 16:47:17 +02:00
Robert Baldyga
630748a1e7
Merge pull request #844 from mmichal10/engine-errors-test
Engine errors test
2024-10-02 16:26:00 +02:00
Michal Mielewczyk
a681f7ec7e pyocf: Test for reporting and accounting IO errors
Test for bug fixed in 237f6c708a

Signed-off-by: Michal Mielewczyk <michal.mielewczyk@huawei.com>
2024-10-02 16:21:10 +02:00
Michal Mielewczyk
6ec4f6cceb pyocf: rio: reads and writes accounting
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@huawei.com>
2024-10-02 15:55:28 +02:00
Michal Mielewczyk
818dacfe89 pyocf: Disarm error volumes in teardown
This prevents obfuscating the actual test errors

Signed-off-by: Michal Mielewczyk <michal.mielewczyk@huawei.com>
2024-10-02 15:52:21 +02:00
Robert Baldyga
575b1abc50
Merge pull request #840 from mmichal10/d2c-dc
Test for IO in d2c after attaching cache
2024-10-02 15:50:12 +02:00
Michal Mielewczyk
191471af1b Test for IO in d2c after attaching cache
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@huawei.com>
2024-10-02 15:33:06 +02:00
Robert Baldyga
1aa9c382c7
Merge pull request #843 from mmichal10/suppress-cache-errors
Don't modify req->error for IOs outside io engines
2024-10-01 14:24:35 +02:00
Michal Mielewczyk
237f6c708a Don't modify req->error for IOs outside io engines
`req->error` should be modified by the request's owner only; hence, if
the request has been allocated to handle IO (i.e. it's not an internal OCF
request) only engines can change it

Signed-off-by: Michal Mielewczyk <michal.mielewczyk@huawei.com>
2024-10-01 14:06:26 +02:00
Robert Baldyga
f59f6e4b33
Merge pull request #842 from robertbaldyga/fix-inline
Place "inline" before the type declaration
2024-10-01 09:52:36 +02:00
Robert Baldyga
3f2b382a2c Place "inline" before the type declaration
It's needed to make OCF compile with kernel 6.11.

Signed-off-by: Robert Baldyga <robert.baldyga@huawei.com>
2024-09-28 09:42:55 +02:00
Robert Baldyga
c978848786
Merge pull request #841 from mmichal10/static-functions
Fix missing 'static' identifier
2024-09-27 12:23:59 +02:00