From: Andreas Gruenbacher <agruenba@redhat.com>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Matthew Wilcox <willy@infradead.org>,
Dave Chinner <david@fromorbit.com>,
linux-fsdevel <linux-fsdevel@vger.kernel.org>,
Linux-MM <linux-mm@kvack.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [RFC 2/4] fs: Add IOCB_NOIO flag for generic_file_read_iter
Date: Tue, 7 Jul 2020 16:30:19 +0200 [thread overview]
Message-ID: <CAHc6FU6LmR7m_8UHmB_77jUpYNo-kgCZ-1YTLqya-PPqvvBy7Q@mail.gmail.com> (raw)
In-Reply-To: <CAHk-=wgpsuC6ejzr3pn5ej5Yn5z4xthNUUOvmA7KXHHGynL15Q@mail.gmail.com>
On Thu, Jul 2, 2020 at 8:06 PM Linus Torvalds
<torvalds@linux-foundation.org> wrote:
> On Thu, Jul 2, 2020 at 9:51 AM Andreas Gruenbacher <agruenba@redhat.com> 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.
>
> This looks sane to me, except for this part:
> > if (!PageUptodate(page)) {
> > - if (iocb->ki_flags & IOCB_NOWAIT) {
> > + if (iocb->ki_flags & (IOCB_NOWAIT | IOCB_NOIO)) {
> > put_page(page);
> > goto would_block;
> > }
>
> This path doesn't actually initiate reads at all - it waits for
> existing reads to finish.
>
> So I think it should only check for IOCB_NOWAIT.
It turns out that label readpage is reachable from here via goto
page_not_up_to_date / goto page_not_up_to_date_locked. So IOCB_NOIO
needs to be checked somewhere. I'll send an update.
Andreas
next prev parent reply other threads:[~2020-07-07 14:30 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-02 16:51 [RFC 0/4] Fix gfs2 readahead deadlocks Andreas Gruenbacher
2020-07-02 16:51 ` [RFC 1/4] gfs2: Revert readahead conversion Andreas Gruenbacher
2020-07-02 16:51 ` [RFC 2/4] fs: Add IOCB_NOIO flag for generic_file_read_iter Andreas Gruenbacher
2020-07-02 18:06 ` Linus Torvalds
2020-07-02 19:58 ` Andreas Gruenbacher
2020-07-02 20:17 ` Linus Torvalds
2020-07-03 9:45 ` Andreas Gruenbacher
2020-07-07 14:30 ` Andreas Gruenbacher [this message]
2020-07-02 16:51 ` [RFC 3/4] gfs2: Rework read and page fault locking Andreas Gruenbacher
2020-07-02 16:51 ` [RFC 4/4] gfs2: Reinstate readahead conversion Andreas Gruenbacher
2020-07-02 18:10 ` [RFC 0/4] Fix gfs2 readahead deadlocks Linus Torvalds
2020-07-02 18:23 ` Andreas Gruenbacher
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=CAHc6FU6LmR7m_8UHmB_77jUpYNo-kgCZ-1YTLqya-PPqvvBy7Q@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;
as well as URLs for NNTP newsgroup(s).