From: Andreas Gruenbacher <agruenba@redhat.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [RFC v2 0/3] Turn iomap_page_ops into iomap_folio_ops
Date: Thu, 1 Dec 2022 19:09:54 +0100 [thread overview]
Message-ID: <20221201180957.1268079-1-agruenba@redhat.com> (raw)
In-Reply-To: <20221201160619.1247788-1-agruenba@redhat.com>
Hi again,
[Same thing, but with the patches split correctly this time.]
we're seeing a race between journaled data writes and the shrinker on
gfs2. What's happening is that gfs2_iomap_page_done() is called after
the page has been unlocked, so try_to_free_buffers() can come in and
free the buffers while gfs2_iomap_page_done() is trying to add them to
the transaction. Not good.
This is a proposal to change iomap_page_ops so that page_prepare()
prepares the write and grabs the locked page, and page_done() unlocks
and puts that page again. While at it, this also converts the hooks
from pages to folios.
To move the pagecache_isize_extended() call in iomap_write_end() out of
the way, a new folio_may_straddle_isize() helper is introduced that
takes a locked folio. That is then used when the inode size is updated,
before the folio is unlocked.
I've also converted the other applicable folio_may_straddle_isize()
users, namely generic_write_end(), ext4_write_end(), and
ext4_journalled_write_end().
Any thoughts?
Thanks,
Andreas
Andreas Gruenbacher (3):
fs: Add folio_may_straddle_isize helper
iomap: Turn iomap_page_ops into iomap_folio_ops
gfs2: Fix race between shrinker and gfs2_iomap_folio_done
fs/buffer.c | 5 ++---
fs/ext4/inode.c | 13 +++++------
fs/gfs2/bmap.c | 39 +++++++++++++++++++++++---------
fs/iomap/buffered-io.c | 51 +++++++++++++++++++++---------------------
include/linux/iomap.h | 24 ++++++++++----------
include/linux/mm.h | 2 ++
mm/truncate.c | 34 ++++++++++++++++++++++++++++
7 files changed, 110 insertions(+), 58 deletions(-)
--
2.38.1
next prev parent reply other threads:[~2022-12-01 18:09 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-01 16:06 [Cluster-devel] [RFC 0/3] Turn iomap_page_ops into iomap_folio_ops Andreas Gruenbacher
2022-12-01 16:06 ` [Cluster-devel] [RFC 1/3] fs: Add folio_may_straddle_isize helper Andreas Gruenbacher
2022-12-01 16:06 ` [Cluster-devel] [RFC 2/3] iomap: Turn iomap_page_ops into iomap_folio_ops Andreas Gruenbacher
2022-12-01 16:06 ` [Cluster-devel] [RFC 3/3] gfs2: Fix race between shrinker and gfs2_iomap_folio_done Andreas Gruenbacher
2022-12-01 18:09 ` Andreas Gruenbacher [this message]
2022-12-01 21:29 ` [Cluster-devel] [RFC v2 0/3] Turn iomap_page_ops into iomap_folio_ops Dave Chinner
2022-12-02 1:54 ` Andreas Gruenbacher
2022-12-05 23:04 ` Dave Chinner
2022-12-01 18:09 ` [Cluster-devel] [RFC v2 1/3] fs: Add folio_may_straddle_isize helper Andreas Gruenbacher
2022-12-01 18:09 ` [Cluster-devel] [RFC v2 2/3] iomap: Turn iomap_page_ops into iomap_folio_ops Andreas Gruenbacher
2022-12-01 18:09 ` [Cluster-devel] [RFC v2 3/3] gfs2: Fix race between shrinker and gfs2_iomap_folio_done 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=20221201180957.1268079-1-agruenba@redhat.com \
--to=agruenba@redhat.com \
/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).