by ejiblabahaba · 1w ago · 0 comments
What's frustrating is even just a little info from the manufactures would be beneficial, like the size of a shingle so the computer could batch writes, or even if the drive is shingled!
In any case, I don't think hobbyists get to play with the non-disk-managed drives, and anyone with the money and the special disks is probably not using ZFS because it's a bit of an uphill battle to fit SMR to a copy-on-write filesystem.
The drive doesn't have enough information to do this itself, we need SMR aware filesystems.
Shouldn't this be especially useful with ZFS doing copy-on-write with linked lists as a reversed heap?
EDIT: So apparently, ZFS ashift is capped at 16 and values along 28 would be necessary to cover entire 256MiB (octet) shingles. Bummer.
EDIT2: The basic problem seems to stem from the exact same assumption that SQLite3 [1] makes: The sector write size for random write access is 512B or 4KiB, or whatever. With SMR and flash erase blocks, random write sector size and random read sector size are vastly different. Will take ages for filesystems to be updated to this new reality and then validated on real workloads.
[1] https://www.sqlite.org/atomiccommit.html, section 2 Hardware Assumptions.
With a reverse B-tree heap it may be fruitful to prefetch a back offset from the end of the file that ends with the top of the heap inclusive and then switch to random single reads for the sparser read access "down" the heap towards the beginning of the file.
Then comes the question of write access. Flash storage seems to be able to write small read-sized sectors into the empty remainders of erase blocks. With SMR the question becomes, whether there is a third sector size like a single track layer where the next overlapping track can be written later. For erasing, the whole shingle needs to be replaced kind of like a flash erase block.
Maybe OpenZFS ashift can be adjusted to single track sizes within a shingle. That would curb write amplification to the physical limitations. At 60 to 150 tracks that still requires ashift between roughly 22 and 20.5 which are both larger than 16. Seems like it is especially bad if there are no common divisors or other rounding problems.
Maybe non-temporal writes and write coalescing like in CPUs become relevant now. Dan Luu seems to be right here. The read(2), write(2), and fsync(2) bedrock of Unix may be forced to be updated to CPU-like caches where barriers, write-backs, etc. are handled separately.
Land of contrasts, even compared to usual engineering trade offs.
Could also expose the drives as SCSI object storage devices
If we take a new hard look at open(2), read(2), and write(2), then let us look at real-world use cases. (Yes, yes, distributed systems. But the demand for at least decent errors is real.)
Sounds like ZFS has the same problem today, it's not aware of SMR, and it treats those drives as if they are regular hard-drives.
https://dropbox.tech/infrastructure/four-years-of-smr-storag...