From: Andreas Gruenbacher <agruenba@redhat.com>
To: Matthew Wilcox <willy@infradead.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
Dave Chinner <david@fromorbit.com>,
linux-fsdevel <linux-fsdevel@vger.kernel.org>,
Linux-MM <linux-mm@kvack.org>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [RFC v2 1/2] fs: Add IOCB_NOIO flag for generic_file_read_iter
Date: Sun, 5 Jul 2020 17:08:21 +0200 [thread overview]
Message-ID: <CAHc6FU7HvPqpBSRQJfbgBgQpjFzYfWfTwq+F-tOUq+-Jc8efQg@mail.gmail.com> (raw)
In-Reply-To: <20200703114108.GE25523@casper.infradead.org>
On Fri, Jul 3, 2020 at 1:41 PM Matthew Wilcox <willy@infradead.org> wrote:
>
> On Fri, Jul 03, 2020 at 11:53:24AM +0200, Andreas Gruenbacher wrote:
> > Add an IOCB_NOIO flag that indicates to generic_file_read_iter that it
> > shouldn't trigger any filesystem I/O for the actual request or for
> > readahead. This allows to do tentative reads out of the page cache as
> > some filesystems allow, and to take the appropriate locks and retry the
> > reads only if the requested pages are not cached.
> >
> > Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
>
> Reviewed-by: Matthew Wilcox (Oracle) <willy@infradead.org>
>
> > @@ -2249,9 +2253,18 @@ EXPORT_SYMBOL_GPL(generic_file_buffered_read);
> > *
> > * This is the "read_iter()" routine for all filesystems
> > * that can use the page cache directly.
> > + *
> > + * The IOCB_NOWAIT flag in iocb->ki_flags indicates that -EAGAIN shall
> > + * be returned when no data can be read without waiting for I/O requests
> > + * to complete; it doesn't prevent readahead.
> > + *
> > + * The IOCB_NOIO flag in iocb->ki_flags indicates that -EAGAIN shall be
> > + * returned when no data can be read without issuing new I/O requests,
> > + * and 0 shall be returned when readhead would have been triggered.
>
> s/shall/may/ -- if we read a previous page then hit a readahead page,
> we'll return a positive value. If the first page we hit is a readahead
> page, then yes, we'll return zero.
How about this?
* The IOCB_NOIO flag in iocb->ki_flags indicates that no new I/O
* requests shall be made for the read or for readahead. When no data
* can be read, -EAGAIN shall be returned. When readahead would be
* triggered, a short read (possibly of length 0) shall be returned.
> Again, I'm happy for the patch to go in as-is without this nitpick.
Thanks,
Andreas
next prev parent reply other threads:[~2020-07-05 15:13 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-03 9:53 [RFC v2 0/2] Fix gfs2 readahead deadlocks Andreas Gruenbacher
2020-07-03 9:53 ` [RFC v2 1/2] fs: Add IOCB_NOIO flag for generic_file_read_iter Andreas Gruenbacher
2020-07-03 11:41 ` Matthew Wilcox
2020-07-05 15:08 ` Andreas Gruenbacher [this message]
2020-07-03 9:53 ` [RFC v2 2/2] gfs2: Rework read and page fault locking Andreas Gruenbacher
2020-07-03 11:38 ` Matthew Wilcox
2020-07-03 11:44 ` Matthew Wilcox
2020-07-03 19:24 ` [RFC v2 0/2] Fix gfs2 readahead deadlocks Linus Torvalds
2020-07-03 19:26 ` Linus Torvalds
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=CAHc6FU7HvPqpBSRQJfbgBgQpjFzYfWfTwq+F-tOUq+-Jc8efQg@mail.gmail.com \
--to=agruenba@redhat.com \
--cc=david@fromorbit.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=torvalds@linux-foundation.org \
--cc=willy@infradead.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox