Kernel Client Pre-Reading Linked List for Random File Access
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Kernel clients face performance issues with random file reading scenarios, as existing pre-reading mechanisms are disabled, leading to suboptimal cache hit rates and file reading performance.
Innovation Solution
A method and system that improve the pre-reading mechanism of kernel clients by constructing a linked list with reading offsets for non-sequential file access, determining reading patterns, and generating map routes based on reading requests and offsets to enhance cache hit rates.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Productivity
If the kernel client uses traditional sequential pre-reading mechanism, then continuous file reading performance is improved, but random reading scenarios cannot be adapted and cache hit rate decreases
Solution Approach 1:
The pre-reading mechanism dynamically adapts to different reading patterns by detecting whether reads are sequential or random. For random reading scenarios, the system dynamically constructs a linked list based on actual reading requests, transforming the static sequential pre-reading approach into a dynamic structure that adapts to access patterns, thereby improving cache hit rates for both sequential and random reads
Solution Approach 2:
The system performs preliminary actions by pre-constructing the linked list structure with reading offsets before actual file reads occur. This allows the system to proactively prepare cache entries for anticipated random access positions, improving cache hit rates by having data ready before it is actually requested
2Measurement precision
If the kernel client disables pre-reading for random reading scenarios, then reading accuracy is maintained, but cache hit rate and file reading performance deteriorate
Solution Approach 1:
The system implements feedback by monitoring actual reading requests and using this information to construct the linked list structure. The reading offsets from actual access patterns feed back into the pre-reading mechanism, allowing the system to learn from actual usage and improve subsequent cache performance while maintaining reading accuracy through precise offset tracking
Solution Approach 2:
The system serves itself by automatically detecting reading patterns and constructing the appropriate linked list structure without external intervention. The kernel client autonomously adapts its pre-reading behavior based on observed access patterns, improving cache performance while maintaining accuracy through self-monitoring and self-adjustment
3Productivity
If the kernel client implements non-sequential pre-reading with linked list, then cache hit rate for random reading is improved, but system complexity increases
Solution Approach 1:
The system segments the file reading process by creating a linked list structure that divides reading offsets into discrete, manageable nodes. Each node represents a specific read position, allowing the complex non-sequential access pattern to be broken down into simpler, independent segments that can be handled efficiently by the cache mechanism
Solution Approach 2:
The linked list structure serves as an intermediary between the complex random access patterns and the cache mechanism. This intermediate data structure translates irregular access patterns into a form that the cache can efficiently handle, reducing the apparent complexity of implementing non-sequential pre-reading while maintaining high cache hit rates
Data Source
AI summary
The present application discloses a pre-reading method and system of a kernel client, and a computer-readable storage medium. The method includes: receiving a reading request for a file and determining whether the reading of the file is continuous; if the reading of the file is discontinuous, generating a head node of a file inode, and constructing a linked list embedded in the head node; determining whether the file includes a reading rule for the file, and if the file includes the reading rule for the file, acquiring, based on the reading rule, the number of reading requests for the file and a reading offset corresponding to each request, generating a map route based on the number of reading requests and corresponding reading offsets, and storing the map route in the linked list; and executing pre-reading based on the linked list.

