Comments (6)
Hi,
maybe I can help out here.
so my interpretation of the man page io_uring_enter
and this link https://unixism.net/loti/tutorial/link_liburing.html is that completions are not in the submission order.
Note that, while I/O is initiated in the order in which it appears in the
submission queue, completions are unordered. For example,
an application which places a write I/O followed by an fsync in
the submission queue cannot expect the fsync to apply to the write.
This is consistent with my experiments (and many other async IO engines) and how SSDs work (highly parallel).
I think if you want to force a strict order then you would need to link the requests as described in the link above.
from liburing.
Hi,
maybe I can help out here.
so my interpretation of the man page
io_uring_enter
and this link https://unixism.net/loti/tutorial/link_liburing.html is that completions are not in the submission order.Note that, while I/O is initiated in the order in which it appears in the submission queue, completions are unordered. For example, an application which places a write I/O followed by an fsync in the submission queue cannot expect the fsync to apply to the write.
This is consistent with my experiments (and many other async IO engines) and how SSDs work (highly parallel). I think if you want to force a strict order then you would need to link the requests as described in the link above.
Thank you very much! Your opinion made me suddenly enlightened. When I use the link flag for all the SQEs in the queue, and then submit them together when the queue is full, can I ensure that the returned CQE is in the order when added to the queue?
from liburing.
Hi,
based on the man page my interpretation is that you will get the CQEs
in submission order:
When this flag is specified, the SQE forms a link with the
next SQE in the submission ring. That next SQE will not be
started before the previous request completes. This, in
effect, forms a chain of SQEs, which can be arbitrarily
long.
But note that (1) a chain cannot be formed across submission boundaries (see IOSQE_IO_LINK
io_uring_enter ) and (2) if you have submissions that are not part of the chain they might complete in between your chain.
But in your example I would suspect that you will get them all in order.
from liburing.
keep in mind that by linking you limit IO queue depth to 1. It might be better to submit SQEs without linking and just track number of competions: when CQEs seen == SQEs sent all IO is done, this way io requests could be done in parallel even if desired outcome is read continuous range from file
from liburing.
Hi,
based on the man page my interpretation is that you will get the
CQEs
in submission order:When this flag is specified, the SQE forms a link with the next SQE in the submission ring. That next SQE will not be started before the previous request completes. This, in effect, forms a chain of SQEs, which can be arbitrarily long.
But note that (1) a chain cannot be formed across submission boundaries (see
IOSQE_IO_LINK
io_uring_enter ) and (2) if you have submissions that are not part of the chain they might complete in between your chain. But in your example I would suspect that you will get them all in order.
Thanks a lot!
from liburing.
keep in mind that by linking you limit IO queue depth to 1. It might be better to submit SQEs without linking and just track number of competions: when CQEs seen == SQEs sent all IO is done, this way io requests could be done in parallel even if desired outcome is read continuous range from file
Thanks a lot!
from liburing.
Related Issues (20)
- io_uring read multishot fails when trying to read a tty HOT 8
- Is there a way to synchronously wait for a completion of a submitted write for a particular FD HOT 2
- redefinition of 'struct in6_pktinfo' when building on ubi7 with gcc/g++ 9.5.0 HOT 5
- Can we know how many bytes we have read by using io_uring_prep_readv method? HOT 1
- RCU calls made by the NAPI busy poll code generates context switches occupying 50% of the time of the CPU hosting the sqp thread HOT 92
- Per-iovec zero-copy and fixed buffer settings for writev/sendmsg HOT 5
- possible socket leakage with direct file descriptors HOT 21
- Ordering guarantees between accept and close? HOT 11
- SYSCHK(syscall(__NR_io_uring_setup, 10, ¶ms)): Invalid argument HOT 3
- io_uring openat non-existing file, cqe->res returns -2, outside of specification HOT 2
- io_uring_prep_recv with IORING_RECVSEND_BUNDLE always fills only one buffer at a time HOT 13
- io_uring_prep_send_bundle should not have len argument HOT 5
- Wrong number of arguments in io_uring_prep_fixed_fd_install man
- test buf-ring-nommap.t failed with -12 (-ENOMEM) in ppc64le arch.
- Long tail between submit event to complete event exceed 1 second
- SQE timeout with IORING_TIMEOUT_ETIME_SUCCESS set return a CQE with res field equal to -ETIME HOT 4
- io_poll and sqpoll cause IOPS degradation
- ppc64le: Tests failed (2): <no-mmap-inval.t> <reg-fd-only.t> HOT 4
- ` io_uring_prep_link_timeout` may return undocumented error -ENOENT HOT 3
- Behavior of io_uring_wait_cqes is not documented for null `ts` HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from liburing.