Soft Updates: A Solution to the Metadata Update Problem in File Systems
Reading notes
Overview
- Metadata: directories, inodes, and free block maps and so on
- Metadata updates: file creation, block allocation and so on
- Soft updates: an implementation technique for low-cost sequencing of fine-grained updates to write-back cache blocks. So, a file system can safely use delayed writes for almost all file operations.
- (unpredictable system crashes -> loss of all information in volatile main memory)
On-disk image of the file system must have
- no dangling pointers to uninitialized space,
- no ambiguous resource ownership caused by multiple pointers
- no live resources to which there are no pointers.
Ordering constraints:
- (1) Never point to a structure before it has been initialized (e.g., an inode must be initialized before a directory entry references it).
- (2) Never reuse a resource before nullifying all previous pointers to it (e.g., an inode’s pointer to a data block must be nullified before that disk block may be reallocated for a new inode).
- (3) Never reset the last pointer to a live resource before a new pointer has been set (e.g., when renaming a file, do not remove the old name for an inode until after the new name has been written).
2. THE METADATA UPDATE PROBLEM
Previous Solutions
- Synchronous Writes.
- Nonvolatile RAM
- Atomic Updates
- Scheduler-Enforced Ordering
- Interbuffer Dependencies
Characteristics of an Ideal Solution
- immediate stability and consistency of all metadata updates with no restrictions on on-disk data organization, no performance overhead, and no special hard- ware support
- Performance-related characteristics of an ideal solution:
- Applications should never wait for disk writes unless they explicitly choose to do so for application-specific purposes.
- The system should propagate modified metadata to disk using the minimum possible number of disk writes, given the allowed window of vulnerability. Specifically, this requires aggressive write-back caching of metadata structures to absorb and coalesce writes.
- The solution should minimize the amount of main memory needed to cache dirty metadata and related auxiliary information. This will maximize the availability of memory for other purposes.
- The cache write-back code and the disk request scheduler should not be constrained in choosing what blocks to write to disk when, beyond the minimal restrictions necessary to guarantee consistency. This flexibil- ity is important for scheduling algorithms that reduce mechanical positioning delays [Denning 1967; Worthington et al. 19
3. Soft Updates
A Cyclic Dependency.
- When creating a new file, the newly initialized inode must be written to disk before the new directory entry.
- When removing a file, the reset directory entry must be written before the reinitialized inode.
Undo/redo operations in soft updates
Class notes
Overview
- What's?
- enable write-back caching of metadata (already have it for data)
- Why?
- performance
- integrity
- recovery
Rule of thumb
- It’s OK to waste some inode or blocks
- But you cannot corrupted or garbage data pointed by something