All of lore.kernel.org
 help / color / mirror / Atom feed
From: Miklos Szeredi <miklos@szeredi.hu>
To: Jens Axboe <axboe@kernel.dk>
Cc: io-uring@vger.kernel.org
Subject: Re: io_uring_prep_openat_direct() and link/drain
Date: Tue, 29 Mar 2022 21:30:26 +0200	[thread overview]
Message-ID: <CAJfpegtr+Bo0O=i9uShDJO_=--KAsFmvdzodwH6qF7f+ABeQ5g@mail.gmail.com> (raw)
In-Reply-To: <89322bd1-5e6f-bcc6-7974-ffd22363a165@kernel.dk>

On Tue, 29 Mar 2022 at 20:40, Jens Axboe <axboe@kernel.dk> wrote:
>
> On 3/29/22 12:31 PM, Miklos Szeredi wrote:
> > On Tue, 29 Mar 2022 at 20:26, Jens Axboe <axboe@kernel.dk> wrote:
> >>
> >> On 3/29/22 12:21 PM, Miklos Szeredi wrote:
> >>> On Tue, 29 Mar 2022 at 19:04, Jens Axboe <axboe@kernel.dk> wrote:
> >>>>
> >>>> On 3/29/22 10:08 AM, Jens Axboe wrote:
> >>>>> On 3/29/22 7:20 AM, Miklos Szeredi wrote:
> >>>>>> Hi,
> >>>>>>
> >>>>>> I'm trying to read multiple files with io_uring and getting stuck,
> >>>>>> because the link and drain flags don't seem to do what they are
> >>>>>> documented to do.
> >>>>>>
> >>>>>> Kernel is v5.17 and liburing is compiled from the git tree at
> >>>>>> 7a3a27b6a384 ("add tests for nonblocking accept sockets").
> >>>>>>
> >>>>>> Without those flags the attached example works some of the time, but
> >>>>>> that's probably accidental since ordering is not ensured.
> >>>>>>
> >>>>>> Adding the drain or link flags make it even worse (fail in casese that
> >>>>>> the unordered one didn't).
> >>>>>>
> >>>>>> What am I missing?
> >>>>>
> >>>>> I don't think you're missing anything, it looks like a bug. What you
> >>>>> want here is:
> >>>>>
> >>>>> prep_open_direct(sqe);
> >>>>> sqe->flags |= IOSQE_IO_LINK;
> >>>>> ...
> >>>>> prep_read(sqe);
> >>>
> >>> So with the below merge this works.   But if instead I do
> >>>
> >>> prep_open_direct(sqe);
> >>>  ...
> >>> prep_read(sqe);
> >>> sqe->flags |= IOSQE_IO_DRAIN;

And this doesn't work either:

prep_open_direct(sqe);
sqe->flags |= IOSQE_IO_LINK;
...
prep_read(sqe);
sqe->flags |= IOSQE_IO_LINK;
...
prep_open_direct(sqe);
sqe->flags |= IOSQE_IO_LINK;
...
prep_read(sqe);

Yeah, the link is not needed for the read (unless the fixed file slot
is to be reused), but link/drain should work as general ordering
instructions, not just in special cases.

Thanks,
Miklos

  reply	other threads:[~2022-03-29 19:30 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-29 13:20 io_uring_prep_openat_direct() and link/drain Miklos Szeredi
2022-03-29 16:08 ` Jens Axboe
2022-03-29 17:04   ` Jens Axboe
2022-03-29 18:21     ` Miklos Szeredi
2022-03-29 18:26       ` Jens Axboe
2022-03-29 18:31         ` Miklos Szeredi
2022-03-29 18:40           ` Jens Axboe
2022-03-29 19:30             ` Miklos Szeredi [this message]
2022-03-29 20:03               ` Jens Axboe
2022-03-30  8:18                 ` Miklos Szeredi
2022-03-30 12:35                   ` Jens Axboe
2022-03-30 12:43                     ` Miklos Szeredi
2022-03-30 12:48                       ` Jens Axboe
2022-03-30 12:51                         ` Miklos Szeredi
2022-03-30 14:58                           ` Miklos Szeredi
2022-03-30 15:05                             ` Jens Axboe
2022-03-30 15:12                               ` Miklos Szeredi
2022-03-30 15:17                                 ` Jens Axboe
2022-03-30 15:53                                   ` Jens Axboe
2022-03-30 17:49                                     ` Jens Axboe
2022-04-01  8:40                                       ` Miklos Szeredi
2022-04-01 15:36                                         ` Jens Axboe
2022-04-01 16:02                                           ` Miklos Szeredi
2022-04-01 16:21                                             ` Jens Axboe
2022-04-02  1:17                                               ` Jens Axboe
2022-04-05  7:45                                                 ` Miklos Szeredi
2022-04-05 14:44                                                   ` Jens Axboe
2022-04-21 12:31                                                     ` Miklos Szeredi
2022-04-21 12:34                                                       ` Jens Axboe
2022-04-21 12:39                                                         ` Miklos Szeredi
2022-04-21 12:41                                                           ` Jens Axboe
2022-04-21 13:10                                                             ` Miklos Szeredi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAJfpegtr+Bo0O=i9uShDJO_=--KAsFmvdzodwH6qF7f+ABeQ5g@mail.gmail.com' \
    --to=miklos@szeredi.hu \
    --cc=axboe@kernel.dk \
    --cc=io-uring@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.