From: Stefan Hajnoczi <[email protected]>
To: Jens Axboe <[email protected]>
Cc: Stefan Hajnoczi <[email protected]>,
Dominique Martinet <[email protected]>,
Stefano Garzarella <[email protected]>,
Aarushi Mehta <[email protected]>,
Julia Suvorova <[email protected]>, Kevin Wolf <[email protected]>,
Hanna Reitz <[email protected]>,
qemu block <[email protected]>,
qemu-devel <[email protected]>,
Filipe Manana <[email protected]>,
[email protected]
Subject: Re: [PATCH v2] io_uring: fix short read slow path
Date: Wed, 6 Jul 2022 08:16:02 +0100 [thread overview]
Message-ID: <CAJSP0QWnw7q_TScW+3g+jwYpjRX922cL4KafUit5oFNWtqRvfA@mail.gmail.com> (raw)
In-Reply-To: <[email protected]>
On Tue, 5 Jul 2022 at 20:26, Jens Axboe <[email protected]> wrote:
>
> On 7/5/22 7:28 AM, Stefan Hajnoczi wrote:
> > On Fri, Jul 01, 2022 at 07:52:31AM +0900, Dominique Martinet wrote:
> >> Stefano Garzarella wrote on Thu, Jun 30, 2022 at 05:49:21PM +0200:
> >>>> so when we ask for more we issue an extra short reads, making sure we go
> >>>> through the two short reads path.
> >>>> (Unfortunately I wasn't quite sure what to fiddle with to issue short
> >>>> reads in the first place, I tried cutting one of the iovs short in
> >>>> luring_do_submit() but I must not have been doing it properly as I ended
> >>>> up with 0 return values which are handled by filling in with 0 (reads
> >>>> after eof) and that didn't work well)
> >>>
> >>> Do you remember the kernel version where you first saw these problems?
> >>
> >> Since you're quoting my paragraph about testing two short reads, I've
> >> never seen any that I know of; but there's also no reason these couldn't
> >> happen.
> >>
> >> Single short reads have been happening for me with O_DIRECT (cache=none)
> >> on btrfs for a while, but unfortunately I cannot remember which was the
> >> first kernel I've seen this on -- I think rather than a kernel update it
> >> was due to file manipulations that made the file eligible for short
> >> reads in the first place (I started running deduplication on the backing
> >> file)
> >>
> >> The older kernel I have installed right now is 5.16 and that can
> >> reproduce it -- I'll give my laptop some work over the weekend to test
> >> still maintained stable branches if that's useful.
> >
> > Hi Dominique,
> > Linux 5.16 contains commit 9d93a3f5a0c ("io_uring: punt short reads to
> > async context"). The comment above QEMU's luring_resubmit_short_read()
> > claims that short reads are a bug that was fixed by Linux commit
> > 9d93a3f5a0c.
> >
> > If the comment is inaccurate it needs to be fixed. Maybe short writes
> > need to be handled too.
> >
> > I have CCed Jens and the io_uring mailing list to clarify:
> > 1. Are short IORING_OP_READV reads possible on files/block devices?
> > 2. Are short IORING_OP_WRITEV writes possible on files/block devices?
>
> In general we try very hard to avoid them, but if eg we get a short read
> or write from blocking context (eg io-wq), then io_uring does return
> that. There's really not much we can do here, it seems futile to retry
> IO which was issued just like it would've been from a normal blocking
> syscall yet it is still short.
Thanks! QEMU's short I/O handling is spotty - some code paths handle
it while others don't. For the io_uring QEMU block driver we'll try to
handle short all I/Os.
Stefan
next prev parent reply other threads:[~2022-07-06 7:16 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <[email protected]>
[not found] ` <[email protected]>
[not found] ` <20220630154921.ekl45dzer6x4mkvi@sgarzare-redhat>
[not found] ` <[email protected]>
2022-07-05 13:28 ` [PATCH v2] io_uring: fix short read slow path Stefan Hajnoczi
2022-07-05 19:23 ` Jens Axboe
2022-07-06 7:16 ` Stefan Hajnoczi [this message]
2022-07-05 22:52 ` Dominique Martinet
2022-07-06 7:17 ` Stefan Hajnoczi
2022-07-06 7:26 ` Dominique Martinet
2022-07-06 7:51 ` Stefan Hajnoczi
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=CAJSP0QWnw7q_TScW+3g+jwYpjRX922cL4KafUit5oFNWtqRvfA@mail.gmail.com \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox