Starting to play with dependent SQEs for io_uring. Enables things like "read data from here, then write to there". Or "open this file, then read this data from it". It's a powerful primitive, and eliminates wait points in sequences of operations.
The goal is to *initiate* immediate writeback, but not to block waiting for it. Now obviously the blocking doesn't matter as much when done through io_uring as it does for plain pwrite(), but it'd require much bigger uring sizes, and a lot more userland buffers for the writes.
-
-
As postgres uses a per-process model (for now at least), the uring sizes + additional buffers wouldn't be exactly free...
-
uring size isn't that costly, each sqe is just 64 bytes and a cqe is 16 bytes. So if you went from needing 256 entries for 128 pending writes instead of just 128 entries, you're using 20kb of memory instead of 10kb. That's hardly more than a single write anyway.
- 3 more replies
New conversation -
-
-
Gotcha, yeah then you probably just want to use an extra sqe entry for that. Outside of needing a bigger sqring size, not sure I follow the "lot more userland buffers" argument?
-
That was about using RWF_SYNC. Without that the time spent for buffered IO is just copying the buffer into the page cache. With SYNC the queue entry would only complete once the IO finished. So the userland buffer pointed to by the SQE can only be reused once the IO is done.
End of conversation
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.