Buffer Cache Management via Segmented Recycle Queues
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Current buffer cache management algorithms in data storage computing devices face challenges with fair aging across threads, leading to inefficient scavenging and increased lock contention due to heuristic-based methods that rely on approximations for buffer priority.
Innovation Solution
Implementing a method that uses global recycle queues and per-thread recycle queues to prioritize and manage buffers, allowing for implicit aging and two-stage scavenging, which reduces lock contention and ensures fair distribution of buffer eviction.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Productivity
If heuristic-based aging algorithms are used in a distributed environment, then buffer eviction can be performed, but fair aging across threads cannot be ensured and lock contention increases
Solution Approach 1:
The patent segments the buffer cache management into multiple independent queues, each associated with a specific thread. This segmentation allows each thread to manage its own buffers independently, ensuring fair aging across threads while reducing lock contention since threads operate on their own queues without needing to acquire global locks.
Solution Approach 2:
The patent introduces per-thread recycle queues as intermediary structures between the buffer cache and the free pool. These queues act as mediators that decouple the aging process from direct buffer eviction, allowing threads to age their own buffers locally without interfering with other threads, thus ensuring fairness and reducing synchronization overhead.
2Speed
If buffers are associated with threads for lockless processing, then parallelism is improved, but uniform distribution and proper aging of buffers cannot be achieved
Solution Approach 1:
The patent segments the buffer cache into per-thread recycle queues, where each queue is associated with a specific thread. This segmentation enables lockless parallelism as each thread operates independently on its own queue, improving speed. Simultaneously, the segmented structure ensures uniform distribution of buffers across threads, addressing the measurement precision issue.
Solution Approach 2:
The patent applies local quality by allowing each thread to have its own recycle queue with thread-specific characteristics. This enables each thread to manage its buffers locally with appropriate aging policies, achieving both parallelism and uniform distribution while maintaining thread-specific buffer management needs.
3Productivity
If current scavenging algorithms are used, then buffer scavenging can be performed, but important buffers associated with one thread may be scavenged before less important buffers associated with another thread
Solution Approach 1:
The patent segments the scavenging process into per-thread operations, where each thread scavenges only from its own recycle queue. This segmentation ensures that buffer prioritization is fair across threads, as each thread's important buffers are evaluated and scavenged independently based on their own priority metrics, preventing the premature scavenging of important buffers.
Solution Approach 2:
The patent implements self-service scavenging where each thread independently manages and scavenges its own buffers from its dedicated recycle queue. This self-service approach ensures that each thread's buffer priorities are respected fairly, as threads make scavenging decisions based on their own buffer characteristics without being affected by other threads' buffer states.
Data Source
AI summary
A method, non-transitory computer readable medium, and data storage computing device that obtains data to be stored in a buffer in a buffer cache, determines a priority of the buffer based on the data, identifies one of a set of global recycle queues based on the priority, and inserts the buffer and metadata into the global recycle queue. When the global recycle queue is determined to be a lowest priority global recycle queue and the buffer is determined to be a least recently used buffer, the buffer is removed from the global recycle queue and inserted into a per-thread recycle queue. When the buffer is least recently used in the per-thread recycle queue, the buffer is removed from the per-thread recycle queue and placed in a free pool. With this technology, buffer cache can be more efficiently managed, particularly with respect to aging and scavenging operations, among other advantages.


