On-Disk Free Space Cache for File System Boot Performance
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Generating a free space cache in file systems is an intensive process, leading to performance slowdowns due to the need to search thousands of blocks in the extent allocation tree to determine available space, which is inefficient and time-consuming.
Innovation Solution
Implementing an on-disk free space cache with a special inode, free space cache item, and header for each block group, allowing only a few blocks to be read to generate the cache, instead of the entire extent allocation tree, and utilizing this cache to create an in-memory cache upon system re-boot.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Measurement precision
If the extent allocation tree is walked to read all extent block groups to generate free space cache, then the free space cache can be generated with complete information, but the process becomes time-consuming and inefficient due to searching thousands of blocks
Solution Approach 1:
The patent applies preliminary action by pre-calculating and storing the free space cache on disk during the file system mounting process. This pre-computed cache is then available for direct use during subsequent operations, eliminating the need to re-traverse the extent allocation tree and significantly reducing the time required to obtain free space information.
Solution Approach 2:
The patent creates a copy of the free space cache structure and stores it on disk. This copy can be quickly loaded into memory when needed, rather than regenerating it by traversing the entire extent allocation tree. The on-disk cache serves as a persistent copy that preserves free space information across reboots and operations.
2Measurement precision
If the entire extent allocation tree is traversed to determine free space, then accurate free space information is obtained, but system performance slows down due to the intensive processing required
Solution Approach 1:
The free space cache is pre-computed during file system mounting and stored on disk. This preliminary computation is performed once when the system is ready, and the results are made available for subsequent operations without requiring repeated traversals of the extent allocation tree, thus maintaining high operational speed.
Solution Approach 2:
Instead of repeatedly traversing the extent allocation tree, the patent uses a copied and pre-computed free space cache structure stored on disk. This copy provides accurate free space information quickly, eliminating the performance penalty of repeated full tree traversals during file system operations.
3Loss of time
If an on-disk free space cache is implemented with special inode and header structures, then cache generation time is reduced by reading only a few blocks, but the device complexity increases due to additional data structures
Solution Approach 1:
The patent segments the free space cache into a specialized on-disk structure with a header and data sections, separate from the main extent allocation tree. This segmentation allows the cache to be stored independently and loaded efficiently, reducing the number of blocks that need to be read while organizing the complexity into a modular, manageable format.
Solution Approach 2:
The patent introduces a free space cache inode and header structure as intermediary elements between the extent allocation tree and the free space cache data. These intermediary structures provide a standardized interface for accessing cache information, simplifying the interaction protocol and enabling efficient block-level reads without requiring complex parsing of the entire tree structure.
Data Source
AI summary
A mechanism for saving a snapshot of free space of a file system on persistent storage is disclosed. A method of the invention includes determining whether generation numbers stored in each of a free space cache inode of an on-disk free space cache of a block group, a free space cache item, and a free space cache header are valid, determining whether a checksum generated for a first page of the free space cache matches a checksum stored in the file system and associated with the free space cache, and adding entries stored in the on-disk free space cache to an in-memory free space cache for the block group kept in volatile memory of a computing device, wherein the on-disk free space cache is stored in persistent data storage indexed by a file system of the computing device.


