Giter Club home page Giter Club logo

Comments (4)

axboe avatar axboe commented on September 18, 2024

The man page is wrong. What the flag means is that dependent links for this SQE will not get failed in case of -ETIME, the request itself will still be posting -ETIME as the result code.

from liburing.

isilence avatar isilence commented on September 18, 2024

The man page is wrong, it's supposed to return -ETIME even with IORING_TIMEOUT_ETIME_SUCCESS.
The flag has never been changing the return code, the only effect is that it doesn't break links. E.g.

sqe = io_uring_get_sqe();
prep_timeout(sqe, flags = 0);
sqe->flags |= IOSQE_LINK;

sqe = io_uring_get_sqe();
prep_read(sqe);

Here the read would never be executed, you'd usually get something like cqe1.res = -ETIME, cqe2.res = -ECANCELED.
If you pass IORING_TIMEOUT_ETIME_SUCCESS, however, you would expect the read to be actually run.

from liburing.

rowe0x avatar rowe0x commented on September 18, 2024

The man page is wrong, it's supposed to return -ETIME even with IORING_TIMEOUT_ETIME_SUCCESS. The flag has never been changing the return code, the only effect is that it doesn't break links. E.g.

sqe = io_uring_get_sqe();
prep_timeout(sqe, flags = 0);
sqe->flags |= IOSQE_LINK;

sqe = io_uring_get_sqe();
prep_read(sqe);

Here the read would never be executed, you'd usually get something like cqe1.res = -ETIME, cqe2.res = -ECANCELED. If you pass IORING_TIMEOUT_ETIME_SUCCESS, however, you would expect the read to be actually run.

Using io_uring_prep_link_timeout to Control Dependent Task Timeout vs. prep_timeout -> (linked) -> read op

What's the difference between using io_uring_prep_link_timeout to control the timeout of a dependent task and using prep_timeout -> (linked) -> read op?

I found that io_uring_prep_link_timeout is not always able to cancel the dependent task.

from liburing.

isilence avatar isilence commented on September 18, 2024

Here the read would never be executed, you'd usually get something like cqe1.res = -ETIME, cqe2.res = -ECANCELED. If you pass IORING_TIMEOUT_ETIME_SUCCESS, however, you would expect the read to be actually run.

Using io_uring_prep_link_timeout to Control Dependent Task Timeout vs. prep_timeout -> (linked) -> read op

What do you mean by "Control Dependent Task Timeout"? I can assume "Dependent Task" is a linked request, but even then I don't understand what it means.

What's the difference between using io_uring_prep_link_timeout to control the timeout of a dependent task and using prep_timeout -> (linked) -> read op?

I found that io_uring_prep_link_timeout is not always able to cancel the dependent task.

The only situation it can legally happen is if the timeout fired when the request it's linked to has already been completed but not yet removed. Something like this:

CPU1                |   CPU2
execute_request();  |
complete_request()  |
  post_cqe();       |
                    |   linked timeout triggered
  cancel_timeout()  |

And it's perfectly ok. Apps can think as if the request got completed before timeout. If you see any other cases, let us know.

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.