4 ms·
It helps me to expand the concept of what is happening. Instead of "asking the computer to write a file," it can be seen as "asking the computer to coordinate
by taeric 3y ago
It helps me to expand the concept of what is happening. Instead of "asking the computer to write a file," it can be seen as "asking the computer to coordinate some information from keyboard, to memory, to disk." You can then expand that to constituent parts. "From memory, to the disk controller, to disk." In this way "disk controller" can easily expand to S3 or some such. And you can begin to enumerate all of the things that have to happen for that to work. (And yes, you could even expand that some, as there is a memory controller and many other things you may want to think about.)
And buffers for efficiency aren't new to computers. Consider returning a book to a library. You drop it off in the return box. Eventually, a worker moves it from returns to processing, where they will then put it on a shelving queue. Where it will eventually be carted around and reshelved. Odds are high that you have some form of buffering before it gets to the return box, even.
- pjc50 3y ago> In this way "disk controller" can easily expand to S3 or some such. Disk semantics are subtly different from S3-style blob semantics in important ways. Crucially the immutability of blobs makes life _much_ easier for the blob storage than the ability to write into the middle of a disk file. Given the latency problem, I think it would be interesting and useful for there to be devices which expose a "blob" API to a bunch of Flash on a PCIe bus, and for there to be a suitable OS API for this. Flash itself is only weakly mutable! You can only write in one direction (usually 1->0) to a Flash cell. To go 0->1 you have to do a block erase on a whole bunch of bits, which takes much longer.
- wtallis 3y ago> I think it would be interesting and useful for there to be devices which expose a "blob" API to a bunch of Flash on a PCIe bus, and for there to be a suitable OS API for this. We're partly there. NVMe has standardized a key-value interface for SSDs, but as with any compatibility-breaking new storage interface it's pretty much only used by and available to large cloud computing companies that can afford to rewrite their entire storage stack to take advantage of it.
- taeric 3y agoOh, for sure! And rotational disk semantics are different from SSD ones. It isn't hard to start to realize that there are some things you can ask the controller to do, that they just can't do. They can pretend to for you, though.
- ilyt 3y agoUntil we start talking about SMR magnetic drives, then they go back to being similar to "need to read to rewrite sector and write it back", althought that's mostly hidden by disk's controller.
- toast0 3y agoOnly some drive-managed SMR drives hide the need to do writes in large blocks. Of course, they hide it the only way they know how: buffer writes as much as possible, but eventually do the slow thing and hope nobody notices the performance fell off a cliff. As I understand it, host-managed SMR drives for enterprise require the host software to do writes in the correct sequence.