Block Cache Thread Model With SPSC Queues for Write I/O Balancing
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Virtualized computing environments do not fully realize the performance improvements of modern storage technologies due to inefficiencies in log-based write cache methods, which lead to increased CPU usage, resource contention, and write amplification issues, and conventional thread models result in inefficient I/O operations.
Innovation Solution
Implementing a thread model with single producer single consumer (SPSC) submission queues and completion queues, using a two skip-list-based data structure for log-based write cache, and a range sort algorithm for page-aligned de-stage I/O operations, along with a buffer for scatter gather lists to optimize I/O operations.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Productivity
If conventional log-based write cache methods are used, then write operations can be performed, but CPU usage increases and resource contention overhead increases
Solution Approach 1:
The patent segments the write cache management into separate consumer threads that process logs independently, dividing the workload to reduce CPU contention and improve parallel processing efficiency
Solution Approach 2:
The patent introduces a ring buffer as an intermediary structure between the producer thread and consumer threads, allowing efficient log passing without direct CPU contention and enabling asynchronous processing
2Productivity
If conventional log-based write cache methods are used, then write operations can be performed, but write amplification occurs
Solution Approach 1:
The patent merges multiple write logs into a single consolidated log structure using the ring buffer, reducing the number of separate write operations to the backend storage and eliminating write amplification
Solution Approach 2:
The patent implements continuous log processing where the ring buffer maintains a continuous stream of logs that are processed sequentially, ensuring that writes are performed only once without redundant operations
3Ease of operation
If single dispatcher I/O is used, then I/O operations can be managed, but I/O throughput is limited
Solution Approach 1:
The patent segments the single dispatcher into multiple consumer threads that each handle I/O operations independently, dividing the workload to increase throughput while maintaining simple per-thread operation logic
Solution Approach 2:
The patent implements a dynamic thread model where consumer threads are created and managed based on workload conditions, allowing the system to scale from single dispatcher to multi-threaded operation as needed
4Productivity
If multiple interrupts are used for I/O operations, then I/O operations can be dispatched, but I/O efficiency decreases
Solution Approach 1:
The patent implements continuous I/O processing where consumer threads process I/O operations without interruption, eliminating the overhead of multiple interrupts and improving overall I/O efficiency
Data Source
AI summary
Requests for a write storage operation are stored in a ring buffer. The write storage operations are executed using polling threads and cache de-stage threads. Dispatchers and worker threads are created for executing the polling threads and cache de-stage threads. Queue pairs for each pair of dispatchers and worker threads are generated. The queue pairs comprise a submission queue and a completion queue. The next available request is retrieved from the ring buffer. A scoring algorithm is used to load balance the queue pairs associated with the worker threads, the scoring algorithm operable to determine a score based a current depth of the submission queue and completion queue.


