File-System Efficiency and Performance
Efficiency 看 space / metadata 是否浪費;performance 看 I/O path 與 latency。兩者常衝突:larger cluster 提升 sequential throughput,但增加 internal fragmentation。
Efficiency Knobs
- inode / FCB preallocation:先花 metadata space,換 allocation speed 與 locality。
- cluster size:大 cluster 減少 pointers、提升 sequential transfer;小檔案會浪費尾端空間。
- metadata fields:功能越多,update 成本越高;例如 last access time 可能讓 read 變成 metadata write。
- pointer size:大 pointer 支援 huge file system,但每個 metadata structure 更大。
- static vs dynamic tables:static 簡單但有固定上限;dynamic 彈性大但管理較複雜。
Performance Techniques
- D-OS-Ch14fa-Buffer_Cache_and_Page_Cache:用 memory cache 減少 storage I/O。
- D-OS-Ch14fb-Synchronous_and_Asynchronous_File_System_Write:在 speed 與 durability/order 之間取捨。
- D-OS-Ch14fc-Read_Ahead_and_Free_Behind:針對 sequential access 做 prefetch / eviction。
HDD 多半瓶頸在 seek;NVM/SSD 可能瓶頸在 write amplification、queue parallelism、CPU/software path。