Multi-lock Cache Segmentation for Multi-threaded Contention

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Current caching systems face inefficiencies due to limited storage capacity in faster memory types, leading to increased cache misses and delays, as they struggle to maintain high hit rates and manage data effectively across multiple threads and systems.

Innovation Solution

Implementing a caching system that uses fixed-size storage blocks to optimize memory efficiency, employs multiple locks to reduce contention in multi-threaded systems, and utilizes a snapshot file to persistently store frequently accessed data, thereby increasing cache hit rates and system performance.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If a single lock is used to protect cache entries, then data consistency is maintained, but contention increases and throughput decreases in multi-threaded systems

Engineering Contradiction:
Improvedata consistencyVSAvoidthroughput
Core Design Contradiction:
ReliabilityVSProductivity

Solution Approach 1:

The cache is divided into multiple regions, each protected by its own lock. This segmentation allows multiple threads to access different regions simultaneously, reducing lock contention while maintaining data consistency within each region. The hash function distributes cache entries across different regions, enabling parallel access patterns.

Inventive Principle:
Principle #1Segmentation

2Loss of time

If the cache size is increased to reduce cache misses, then more data can be stored in faster memory, but the complexity of cache management increases

Engineering Contradiction:
Improvecache miss penaltyVSAvoidcache management complexity
Core Design Contradiction:
Loss of timeVSDevice complexity

Solution Approach 1:

The cache is organized into multiple regions with each region managed independently. This segmentation simplifies the management of large cache sizes by allowing localized eviction and replacement policies within each region, rather than managing the entire cache as a single unit.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

Each cache region can have its own characteristics and management properties. The hash function and region assignment create local quality differences that allow tailored management strategies for different parts of the cache, improving overall manageability.

Inventive Principle:
Principle #3Local quality

3Ease of manufacture

If fixed-size storage blocks are used, then memory allocation is simplified and fragmentation is reduced, but memory efficiency decreases due to unused space in variable-sized data items

Engineering Contradiction:
Improvememory allocation simplicityVSAvoidmemory efficiency
Core Design Contradiction:
Ease of manufactureVSLoss of substance

Solution Approach 1:

Multiple smaller data items that would normally require separate fixed-size blocks are merged into a single storage block. The system tracks the actual size of data items and consolidates them, reducing the total number of blocks needed and improving memory efficiency while maintaining the simplicity of fixed-size block management.

Inventive Principle:
Principle #5Merging (Combining)

Data Source

PatentUS9229869B1Multi-lock caches
Publication Date: 2016.01.05 AMAZON TECH INC
  • US9229869B1 patent drawing
  • US9229869B1 patent drawing
  • US9229869B1 patent drawing

AI summary

Processes are disclosed for decreasing contention in caches in order to increase the efficiency of multi-threaded or multi-processor systems. By using multiple locks in a cache, smaller portions of the cache can be locked during cache updates (e.g., during a data update or a storage block eviction). As only small portions of the cache are locked at any given time, contention between threads, particularly in multi-processor implementations, will likely be reduced. For example, if different threads are trying to update different entries in the cache, the threads can proceed with updating the cache concurrently.