Remix.run Logo
stingraycharles 9 hours ago

Don’t block devices have a scheduler with a queue under the hood? Couldn’t that queue become full when writing?

(This is a genuine question)

yarosv 9 hours ago | parent | next [-]

from open(2):

    Note that this flag has no effect for regular files and block devices; that is, I/O operations will (briefly) block when device activity is required, regardless  of  whether O_NONBLOCK  is  set.  Since O_NONBLOCK semantics might eventually be implemented, applications should not depend upon blocking behavior when specifying this flag for regular files and block devices.
RantyDave 6 hours ago | parent | prev | next [-]

This is one of the things that changed when we moved from SATA to NVME. SATA has only a few "in flight" instructions and NVME does 64k.

Begs a question though: are there any NVME "spinny rust" disks?

WD-42 7 hours ago | parent | prev [-]

I’m pretty sure spinning HDDs can have rather complex controllers that actually try to optimize access at the block level by minimizing the amount the read head needs to travel. So yea there are some buffers in there.