Skip to content

Decouple metadata concurrency layer from metadata layer - #982

Merged
robertbaldyga merged 8 commits into
Open-CAS:masterfrom
robertbaldyga:metadata-concurrency-decouple
Oct 8, 2026
Merged

robertbaldyga merged 8 commits into
Open-CAS:masterfrom
robertbaldyga:metadata-concurrency-decouple

Conversation

@robertbaldyga

Copy link
Copy Markdown
Member

No description provided.

Move the fields to the metadata structure and add accessors.
This allows to drop reverse dependency on ocf_cache_priv.h in metadata.h.

Signed-off-by: Robert Baldyga <robert.baldyga@unvertical.com>
Collision segment pages flushed at runtime are already protected by
collision page locks, which keep each cache line consistent. All other
segments are flushed only from management operations, and nothing
changes their content concurrently. The shared global lock adds no
protection, and it delays I/O-path metadata flushes behind exclusive
management sections.

Signed-off-by: Robert Baldyga <robert.baldyga@unvertical.com>
Page locks keep pages of metadata flushed at runtime consistent. They
are a property of how a metadata segment is persisted, not of cache
concurrency. Let raw own them, and drop the page lock callbacks and
the collision lock interface from metadata concurrency.

Signed-off-by: Robert Baldyga <robert.baldyga@unvertical.com>
Initialize synchronization primitives only for metadata segments that
use flush_async and block asynchronous flush for all the other segments.

Signed-off-by: Robert Baldyga <robert.baldyga@unvertical.com>
The metadata lock protects cache mapping consistency, which is
a concern of the concurrency layer, not of metadata itself. Move
its definition to concurrency/ocf_metadata_lock.h and its instance
from struct ocf_metadata to struct ocf_cache.

Signed-off-by: Robert Baldyga <robert.baldyga@unvertical.com>
The metadata lock lives as long as the cache, so initialize it
together with other cache locks in mngt, and do the attach-time
part in ocf_concurrency_init(). Metadata no longer initializes or
uses the metadata lock.

Signed-off-by: Robert Baldyga <robert.baldyga@unvertical.com>
Also rename metadata_structs.h to metadata_priv.h, as the role of
the header changed recently.

Signed-off-by: Robert Baldyga <robert.baldyga@unvertical.com>
Signed-off-by: Robert Baldyga <robert.baldyga@unvertical.com>
@robertbaldyga
robertbaldyga force-pushed the metadata-concurrency-decouple branch from b0daf75 to 0477530 Compare October 7, 2026 22:08
@robertbaldyga
robertbaldyga merged commit fb9e587 into Open-CAS:master Oct 8, 2026
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant