4 ms·
I actually want to explore this further sometime. It's not like it's a secret that buffers are everywhere in computers, but I am still surprised at how many buf
by dmazin 3y ago
I actually want to explore this further sometime. It's not like it's a secret that buffers are everywhere in computers, but I am still surprised at how many buffers one comes across.
Like, let's say you are doing some writing using the C standard library...
* the library itself will buffer your writes, to reduce the number of syscalls
* I think your bio objects might get buffered, via plugging, to reduce the number of block requests
* your block requests will get buffered, so that they can be canceled or merged (I'm actually not sure if this happens in the "software staging queue" part of blk-mq, or prior...)
* as you mentioned, the disk controller may very well buffer the actual write operations
- hoten 3y agoJohn Carmack's lecture on systems engineering / reducing latency for VR mentions buffers repeatedly: https://youtu.be/lHLpKzUxjGk https://youtu.be/lHLpKzUxjGk
- formerly_proven 3y ago> I actually want to explore this further sometime. It's not like it's a secret that buffers are everywhere in computers, but I am still surprised at how many buffers one comes across. Well there's a reason it takes a click or key press to register about as long as it takes sending a packet halfway across the world (or a few times around the world, depending on what software you're running).
- ryandrake 3y agoIt must have been a real blast back in the 8-bit days, when you'd have some peripheral's port mapped to a specific address in the memory map, and setting a byte to that address actually slammed the electrons into that peripheral's register. No wasteful 15 layers of OS abstractions waiting for buffers to fill and copying bytes from buffer to buffer all the way down.