File Block Pre-fetching via Allocation Pattern Detection
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
In block-based file systems, reading data and indirect blocks efficiently is hindered when they are not stored in consecutive blocks, leading to delays due to the need to traverse non-contiguous block locations, especially for larger files.
Innovation Solution
A method that involves reading the inode, determining the file tree height, and checking if block pointers align with a known allocation pattern, allowing for pre-fetching and verification of file blocks before retrieving data blocks, optimizing the reading process by exploiting contiguous block patterns when present.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Adaptability or versatility
If files are stored using non-contiguous blocks to handle varying file sizes flexibly, then storage adaptability is improved, but reading speed deteriorates due to delays in accessing scattered block locations
Solution Approach 1:
The system performs preliminary actions by pre-fetching indirect blocks and data blocks before they are actually needed for file reading. When the file system detects that blocks are stored in consecutive locations, it proactively reads them into memory in advance, eliminating waiting delays during actual file access operations.
Solution Approach 2:
The system dynamically adjusts its reading strategy based on the actual block allocation pattern. It detects whether blocks are stored consecutively or non-contiguously and adapts its pre-fetching behavior accordingly, enabling optimal reading performance for both contiguous and scattered block arrangements.
2Adaptability or versatility
If the file system traverses non-contiguous block locations to read files, then flexibility in block allocation is maintained, but access time increases due to scattered read operations
Solution Approach 1:
The system performs preliminary actions by pre-fetching indirect blocks and data blocks before they are actually needed for file reading. When the file system detects that blocks are stored in consecutive locations, it proactively reads them into memory in advance, eliminating waiting delays during actual file access operations.
Solution Approach 2:
When consecutive block patterns are detected, the system skips the normal sequential traversal process and directly reads multiple blocks in advance, rushing through the access operation to minimize the time spent on scattered read operations.
3Speed
If pre-fetching is performed for all files regardless of block pattern, then reading speed improves, but energy consumption increases unnecessarily
Solution Approach 1:
The system applies different quality levels of pre-fetching to different files based on their local characteristics. It detects the block allocation pattern for each file and applies aggressive pre-fetching only to files with consecutive block patterns, while using standard reading methods for files with non-contiguous patterns, thus optimizing energy usage.
Solution Approach 2:
The system changes the pre-fetching parameter (whether to pre-fetch or not) based on the detected block allocation pattern. By monitoring the block pattern parameter and adjusting the pre-fetching behavior accordingly, the system achieves speed improvements only when the energy investment is worthwhile.
Data Source
AI summary
A system and method for reading file blocks includes reading an inode associated with the file from the file system, the inode including one or more first block pointers, determining a height of a file tree associated with the file, and determining whether a value of a second block pointer selected from the one or more first block pointers is consistent with the file having been stored using a block allocation pattern. When the value of the second block pointer is consistent with the file having been stored using the block allocation pattern the method further includes pre-fetching a plurality of file blocks based on the block allocation pattern, verifying that the pre-fetched file blocks are consistent with the file tree, and retrieving one or more data blocks of the file. In some examples, the block allocation pattern corresponds to the file being stored in streaming order to consecutively and contiguously located blocks.


