Git Product home page Git Product logo

Comments (6)

toziegler avatar toziegler commented on August 22, 2024

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.

aidosww avatar aidosww commented on August 22, 2024

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.

toziegler avatar toziegler commented on August 22, 2024

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.

redbaron avatar redbaron commented on August 22, 2024

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.

aidosww avatar aidosww commented on August 22, 2024

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.

aidosww avatar aidosww commented on August 22, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.