Contention-Free Cache Lookup via Hash Signature Verification

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

In distributed object stores, contention for metadata access leads to performance bottlenecks, especially when multiple I/O threads concurrently perform cache operations such as lookups, insertions, and evictions.

Innovation Solution

A method and system for contention-free lookup operations in a cache, where a cache manager maps a key using a hash function, walks a collision chain, and acquires an entry lock to ensure that the key matches, allowing for efficient data retrieval without synchronization primitives that introduce contention.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Productivity

If multiple I/O threads concurrently access metadata in a distributed object store, then the system can handle more operations in parallel, but contention for metadata access increases and creates performance bottlenecks

Engineering Contradiction:
Improveconcurrent operation capacityVSAvoidmetadata access contention
Core Design Contradiction:
ProductivityVSDevice complexity

Solution Approach 1:

The metadata cache is segmented into multiple independent hash tables, each with its own bucket array. This segmentation allows different I/O threads to access different hash tables or even different buckets within the same hash table concurrently without interfering with each other, thereby reducing metadata access contention while maintaining high concurrent operation capacity

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

Each bucket in the hash table is equipped with its own lock mechanism, allowing fine-grained concurrency control. Threads can access different buckets simultaneously without acquiring global locks, and the local lock scope minimizes the critical section duration. This local quality approach enables high parallelism while managing metadata access efficiently

Inventive Principle:
Principle #3Local quality

2Reliability

If traditional synchronization primitives are used to protect cache operations, then data consistency is maintained, but lookup operations become blocked and performance decreases

Engineering Contradiction:
Improvedata consistencyVSAvoidlookup operation speed
Core Design Contradiction:
ReliabilityVSProductivity

Solution Approach 1:

The system pre-calculates and stores hash values for metadata keys in the cache entry headers. When a lookup operation occurs, the system performs a quick hash comparison first before acquiring any locks. This preliminary action filters out most non-matching keys without requiring synchronization, allowing only potentially matching entries to proceed to locked operations, thereby maintaining data consistency while dramatically improving lookup speed

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

A signature field is introduced as an intermediary between the key and the locked data structure. The signature contains a hash of the key and can be compared without holding locks. This intermediary layer acts as a filter that eliminates the need for most locked comparisons, maintaining reliability through selective locking while improving productivity by avoiding unnecessary lock acquisitions

Inventive Principle:
Principle #24Intermediary (Mediator)

3Reliability

If the cache uses a single global lock for metadata operations, then thread safety is ensured, but concurrent access by multiple I/O threads is blocked

Engineering Contradiction:
Improvethread safetyVSAvoidconcurrent access performance
Core Design Contradiction:
ReliabilityVSProductivity

Solution Approach 1:

The global lock is segmented into multiple independent bucket-level locks, with each bucket having its own lock instance. This segmentation allows multiple I/O threads to acquire different bucket locks simultaneously and perform operations on different buckets in parallel. Thread safety is maintained within each bucket while concurrent access performance improves significantly across the entire cache structure

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The locking mechanism transitions from a single-dimensional global lock to a multi-dimensional hierarchical locking structure where locks are organized by hash table and bucket levels. This dimensional change allows threads to navigate the hierarchy and acquire only the specific locks they need, enabling fine-grained parallelism while ensuring thread safety at each level of the hierarchy

Inventive Principle:
Principle #17Another dimension (Dimensionality change)

Data Source

PatentUS12222866B2Mechanisms for a contention free lookup in a cache with concurrent insertions and deletions
Publication Date: 2025.02.11 SAMSUNG ELECTRONICS CO LTD
  • US12222866B2 patent drawing
  • US12222866B2 patent drawing
  • US12222866B2 patent drawing

AI summary

A method of contention-free lookup including mapping a key of a cache lookup operation to determine an expected location of object data, walking a collision chain by determining whether a cache header signature matches a collision chain signature, when the cache header signature does not match, again walking the collision chain, when the cache header signature matches, determining whether a key in the cache header signature matches the key of the cache lookup operation, when the key does not match, reading a cache entry corresponding to the cache lookup operation, and repopulating the cache entry, when the key matches, acquiring an entry lock, and determining whether the key still matches after acquiring the entry lock, when the key still matches finding the object data in the expected location, and when the key no longer matches, releasing the entry lock, and again walking the collision chain.