write / fsync ordering
Hi everyone,
Can someone point out if io_uring may reorder write and fsync requests?
If I submit a write request and an fsync request at the same time, does that mean that fsync will sync that write request, or does it only sync completed requests?
Signature · 2 lines
With best regards, Vitaliy Filippov
Quoted 7 lines · Vitaliy Filippov
Hi everyone,
Can someone point out if
io_uringmay reorder write and fsync requests?If I submit a write request and an fsync request at the same time, does that mean that fsync will sync that write request, or does it only sync completed requests?
Yes, it can reorder them. So, there are 2 ways:
- wait for the completion
- order the requests within io_uring
I'd recommend the ordering option by using IOSQE_IO_LINK, which guarantees sequential execution of linked requests. There is also IOSQE_IO_DRAIN, but it's rather inefficient.
Signature · 1 line
Pavel Begunkov
Thanks, I'll try it :)
Quoted 7 lines
Yes, it can reorder them. So, there are 2 ways:
- wait for the completion
- order the requests withinio_uringI'd recommend the ordering option by using
IOSQE_IO_LINK, which guarantees sequential execution of linked requests. There is alsoIOSQE_IO_DRAIN, but it's rather inefficient.
Signature · 2 lines
With best regards, Vitaliy Filippov