Cache Metadata Update via Segmented Spinlock for Deduplication
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing data storage systems face performance issues due to contention when updating reference counts for deduplication, leading to queueing and blocking of deduplication transactions, especially across multiple nodes, and the invalidation of cached metadata pages results in cache misses and performance degradation.
Innovation Solution
A method that uses a combination of a non-exclusive lock and a spinlock to allow concurrent access to the cached metadata page, enabling a single writer to update the reference count while allowing multiple readers to access it, ensuring data integrity and maintaining a valid cached copy without requiring exact up-to-date values, and updating multiple cache lines in a defined sequence to guarantee consistency.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If a spinlock is used to prevent concurrent updates of the cached MD page, then data integrity is improved, but system performance deteriorates due to blocking of deduplication transactions
Solution Approach 1:
The reference count field is segmented into two separate cache lines, allowing independent access patterns. The first cache line contains the upper bits and the second contains the lower bits, enabling readers to access one portion while writers update another, thus reducing contention while maintaining atomicity of the complete reference count value.
2Measurement precision
If cached metadata pages are invalidated to ensure data consistency, then measurement precision is improved, but cache hit rates deteriorate causing performance degradation
Solution Approach 1:
The system performs preliminary actions by establishing a defined update sequence for the two cache lines before readers access the data. Writers update cache line 0 first, then cache line 1, ensuring that readers who access cache line 0 will always see a consistent (though potentially stale) value, eliminating the need for invalidation while maintaining consistency guarantees.
3Productivity
If concurrent access is allowed to the cached MD page, then productivity is improved, but manufacturing precision deteriorates due to potential inconsistency
Solution Approach 1:
The patent introduces an intermediary mechanism in the form of a defined update sequence that mediates between writers and readers. By requiring writers to update cache line 0 before cache line 1, the system creates an intermediate state that guarantees consistency: readers accessing cache line 0 will see a value that is guaranteed to be in a valid state, even if cache line 1 is not yet updated.
Data Source
AI summary
In at least one embodiment, processing can include acquiring a spinlock on a cached copy of a metadata (MD) page includes a field stored in two cache lines; updating a register to include an updated value of the field; determining whether a first portion of the updated value of the register is non-zero, wherein two portions of the updated value of the field as stored in the register correspond to the two cache lines; and responsive to determining that the first portion of the updated value of the register is non-zero, performing processing including: storing the first portion of the updated value of the field from the register in the first cache line; and subsequent to performing storing the first portion, storing the second portion of the updated value of the field as stored in the register in the second cache line.


