date
slug
status
tags
summary
type
Problem: FS Consistency after a crash
File System Inconsistencies
- lost some file data: tolerable
- inconsistent metadata: not tolerable
- metadata could include: inode, directory, bitmap for resouce management
fsck: File System Checker
- check & restore consistency
- takes long time to run
- can’t always restore consistency, may need human intervention
File Buffer Cache
- caches data in memory
- write back to disk periodically
- hold data and metadata
- fsync syscall: force to flush to disks
Consistency in FFS
- update metadata synchronously
Soft Updates: A Solution to the Metadata Update Problem in File Systems
Ordering Constraints in FS
- no dangling pointers: initilize before pointing to an object
- don’t reuse until old pointers be removed
- never reset old pointers until new pointers persists (example: rename file)
Approach
- write modifications to buffer cache
- track dependencies between blocks
- write blocks asynchronously in a safe order (blocks with no dependencies should be written first ideally)
Challenges: circular dependencies
- if dependencies are tracked at block level, there are often circular dependencies
Dependencies
- Create files: (ordering constraint 1)
- create a inode
- update directory entry to points to it
- Delete files: (ordering constrains 2)
- remove directory entry
- update inode
Softupdate Solutions
- fine-grained dependency tracking: track at pointer level
- undo/redo
- temporarily undo updates in memory
- write back
- redo updates in memory
Overhead
- cpu overhead: extra work such as undo / redo and mataining dependencies
- memory overhead: track dependencies data structures
Optimizations
- write many blocks at once (when no dependencies)
- skip write that are undone
Evaluation
- Conventional FFS: reliable, poor performance
- FFS async write (No-Order): good performance, no consistency guarentee
- Softupdate
- Write Ahead Logging
- result: performance approaches no-order, better recovery
Summary
- metadata consistency and ordering constraints
- softupdates:
- fine-grained dependency tracking
- undo / redo
SplitFS: Reducing Software Overhead in File Systems for Persistent Memory
Persistent Memory
- attached via memory bus (faster than PCIe)
- released by Intel at around 2019
PM Property
- persistent
- 1 / 2 - 1 / 3 bandwidth of DRAM
- 2 - 4x slower than DRAM
- load / store interface
- larger capacity than DRAM, smaller than disks
- byte addressable
Challenges: caching
- need to force write through
- non-temporal move MOVNT on x86
- flush CLFLUSH on x86
- fence instructions to prevent reordering
SplitFS
- NOVA: in kernel FS
- Others: in user FS
- SplitFS: hybrid approach
- data operations: in user space
- meta data operations: in kernel space
- optimize common case (data operations)
- goal: handle unmodified apps
- use staging files for consistency
- use relink to avoid copy


Summary
- hybrid (user/kernel) FS for persistent memory
- optimize for data operations
- staging files & relink
- Author:Lifan Sun
- URL:stevensun.site/article/cse221-lec13
- Copyright:All articles in this blog, except for special statements, adopt BY-NC-SA agreement. Please indicate the source!
Relate Posts
CSE221 - lec18: File System Cont. : GFS

CSE221 - lec17: Networking: IX & Snap

CSE221 - lec16: Networking: RPC & Receive Livelock

CSE221 - lec15: Scalability: RCU & Analysis of Linux Scalability

CSE221 - lec14: Scheduling:Scheduler Activation & Decades of Wasted Cores

CSE221 - lec12: File System: FFS & LFS
