All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andreas Gruenbacher <agruenba@redhat.com>
To: Matthew Wilcox <willy@infradead.org>
Cc: Dave Chinner <david@fromorbit.com>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	linux-fsdevel@vger.kernel.org, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org,
	Andreas Gruenbacher <agruenba@redhat.com>
Subject: [RFC 0/4] Fix gfs2 readahead deadlocks
Date: Thu,  2 Jul 2020 18:51:16 +0200	[thread overview]
Message-ID: <20200702165120.1469875-1-agruenba@redhat.com> (raw)

Hi all,

commit d4388340ae0b ("fs: convert mpage_readpages to mpage_readahead")
converted gfs2 and other filesystems from the ->readpages to the
->readahead address space operation.  Due to gfs2 doing its locking in
the ->readpage and ->readahead address space operations rather than at a
higher level, this is leading to deadlocks.  Switching to a trylock
operation in ->readahead improves things but doesn't eliminate all
deadlocks; the only reasonable fix seems to be to lift gfs2's locking to
the ->fault vm operation and ->read_iter file operation.

However, gfs2 includes an optimization that allows reads to be served
out of the page cache without any filesystem locking.  This optimization
is important in concurrent read scenarios.  The best way we could find
to preserve this optimization is by introducing a new IOCB_NOIO flag for
generic_file_read_iter.

Introducing this new flag may be too big a change for 5.8.  So this
patch queue takes a different approach:  it first walks back gfs2's
conversion to ->readahead.  Then it introduces IOCB_NOIO, fixes the
locking, and re-applies the readahead conversion.

Of this patch queue, either only the first patch or all four patches can
be applied to fix gfs2's current issues in 5.8.  Please let me know what
you think.

Thanks,
Andreas

Andreas Gruenbacher (4):
  gfs2: Revert readahead conversion
  fs: Add IOCB_NOIO flag for generic_file_read_iter
  gfs2: Rework read and page fault locking
  gfs2: Reinstate readahead conversion

 fs/gfs2/aops.c     | 45 +------------------------------------
 fs/gfs2/file.c     | 55 ++++++++++++++++++++++++++++++++++++++++++++--
 include/linux/fs.h |  1 +
 mm/filemap.c       | 16 ++++++++++++--
 4 files changed, 69 insertions(+), 48 deletions(-)

-- 
2.26.2


             reply	other threads:[~2020-07-02 16:51 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-02 16:51 Andreas Gruenbacher [this message]
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 18:06     ` Linus Torvalds
2020-07-02 19:58     ` Andreas Gruenbacher
2020-07-02 19:58       ` Andreas Gruenbacher
2020-07-02 20:17       ` Linus Torvalds
2020-07-02 20:17         ` Linus Torvalds
2020-07-03  9:45         ` Andreas Gruenbacher
2020-07-03  9:45           ` Andreas Gruenbacher
2020-07-07 14:30     ` Andreas Gruenbacher
2020-07-07 14:30       ` Andreas Gruenbacher
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:10   ` Linus Torvalds
2020-07-02 18:23   ` Andreas Gruenbacher
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=20200702165120.1469875-1-agruenba@redhat.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 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.