[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20221201180957.1268079-1-agruenba@redhat.com>
Date: Thu, 1 Dec 2022 19:09:54 +0100
From: Andreas Gruenbacher <agruenba@...hat.com>
To: Christoph Hellwig <hch@...radead.org>,
"Darrick J . Wong" <djwong@...nel.org>,
Alexander Viro <viro@...iv.linux.org.uk>,
Matthew Wilcox <willy@...radead.org>
Cc: Andreas Gruenbacher <agruenba@...hat.com>,
linux-xfs@...r.kernel.org, linux-fsdevel@...r.kernel.org,
linux-ext4@...r.kernel.org, cluster-devel@...hat.com
Subject: [RFC v2 0/3] Turn iomap_page_ops into iomap_folio_ops
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
Powered by blists - more mailing lists