fc fs筆記
https://blog.stuffedcow.net/2019/09/hard-disk-geometry-microbenchmarking/
(自己的筆記經常找不到鏈接於是記錄一下) 通過 microbenchmarking 測量 LBA 間跳轉消耗的 seek time 來測量現代 hdd 上 LBA 的具體物理扇區映射關係。可以看出近現代硬盤上扇區佈局已經發展到傳統的柱面之類的概念沒有什麼實際意義了
糊锅
A kernel without buffer heads https://lwn.net/SubscriberLink/930173/c288defca11561e8/
關了 buffer heads 支持會得到一個有 xfs btrfs 沒有 ext4 f2fs jfs ntfs3 fat 和 dm 的內核
https://www.vidarholen.net/contents/blog/?p=479 tl;dr: dd works for reading and writing disks, but it has no "low level I/O" capabilities that make it more suited for this than any other shell utility. Like cat you should use it where it makes sense, e.g. to take advantage of its wide array of options, rather than try to ensure that all disk related commands begin and end with dd out of fear and superstition.
https://lore.kernel.org/linux-btrfs/20231217165359.604246-1-hch@lst.de/ host-aware SMR hdd 從 SCSI / ATA 標準中刪掉了(NVMe 標準中沒有加過),今後就只會有 host-managed 和 device-managed SMR 了。 Linux 內核會把現存少量的 host-aware SMR 設備當作 device-managed SMR (OS 看來是普通的 HDD )用
https://www.evanjones.ca/durability-nvme.html
關於 NVMe 設備上寫入的語義的一些解讀,引用到了 NVMe 標準,對不想細讀標準是一個不錯的總結
🥰4
Forwarded from Linux - Reddit
👍4
fc fs筆記
https://despairlabs.com/blog/posts/2025-03-13-fsync-after-open-is-an-elaborate-no-op/ fsync 具體行為有多模糊
Linux and ext4 however does not (or at least, didn’t used to). It used to both clear the error state and mark the page clean, but valid. In all respects it looked like a page freshly read from disk. But, that data was not on disk (the write failed!), any attempt to flush it would do nothing (it’s not dirty). But, because it’s a clean page, it’s eligible for eviction, resulting in the weird situation that you could read data from it and it “worked”, and read it again later and it faults. This is all perfectly legal, and I imagine more efficient in some situations – if it’s clean then there’s no I/O to do, but if it’s valid there’s no fault to process.
And our program would never know, because it misunderstood what a successful fsync() meant.

原來 ext4 上 fsync 還有這種行為…
😱2