linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/5] ext4: fix insufficient credits when writing back large folios
@ 2025-05-30  6:28 Zhang Yi
  2025-05-30  6:28 ` [PATCH 1/5] ext4: restart handle if credits are insufficient during writepages Zhang Yi
                   ` (4 more replies)
  0 siblings, 5 replies; 12+ messages in thread
From: Zhang Yi @ 2025-05-30  6:28 UTC (permalink / raw)
  To: linux-ext4
  Cc: linux-fsdevel, linux-kernel, tytso, adilger.kernel, jack, ojaswin,
	yi.zhang, yi.zhang, libaokun1, yukuai3, yangerkun

From: Zhang Yi <yi.zhang@huawei.com>

This series addresses the issue that Jan pointed out regarding large
folios support for ext4[1]. The problem is that the credits calculation
may insufficient in ext4_meta_trans_blocks() when allocating blocks
during write back a sufficiently large and discontinuous folio, it
doesn't involve the credits for updating bitmap and group descriptor
block. However, if we fix this issue, it may lead to significant
overestimation on the some filesystems with a lot of block groups.

The solution involves first reserving credit for one page when writing
back a sufficiently large and discontinuous folio, and then attempting
to extend the current transaction's credits. If the credits reach the
upper limit, the handler stops and initiates a new transaction. Again,
fix the wrong credits calculation in ext4_meta_trans_blocks(). Finally,
this solution only works in dioread_nolock mode, so disable large folios
if dioread_nolock is disabled. Please see the following patches for
details.

[1] https://lore.kernel.org/linux-ext4/ht54j6bvjmiqt62xmcveqlo7bmrunqs4ji7wikfteftdjijzek@7tz5gpejaoen/

Thanks,
Yi.

Zhang Yi (5):
  ext4: restart handle if credits are insufficient during writepages
  ext4: correct the reserved credits for extent conversion
  ext4/jbd2: reintroduce jbd2_journal_blocks_per_page()
  ext4: fix insufficient credits calculation in ext4_meta_trans_blocks()
  ext4: disable large folios if dioread_nolock is not enabled

 fs/ext4/ext4_jbd2.h  | 14 ++++++++++
 fs/ext4/inode.c      | 64 +++++++++++++++++++++++++++++++++++---------
 fs/jbd2/journal.c    |  6 +++++
 include/linux/jbd2.h |  1 +
 4 files changed, 72 insertions(+), 13 deletions(-)

-- 
2.46.1


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2025-06-07  3:54 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-30  6:28 [PATCH 0/5] ext4: fix insufficient credits when writing back large folios Zhang Yi
2025-05-30  6:28 ` [PATCH 1/5] ext4: restart handle if credits are insufficient during writepages Zhang Yi
2025-06-05 14:04   ` Jan Kara
2025-06-06  6:54     ` Zhang Yi
2025-06-06 13:16       ` Jan Kara
2025-06-07  3:54         ` Zhang Yi
2025-05-30  6:28 ` [PATCH 2/5] ext4: correct the reserved credits for extent conversion Zhang Yi
2025-06-05 11:32   ` Jan Kara
2025-05-30  6:28 ` [PATCH 3/5] ext4/jbd2: reintroduce jbd2_journal_blocks_per_page() Zhang Yi
2025-05-30  6:28 ` [PATCH 4/5] ext4: fix insufficient credits calculation in ext4_meta_trans_blocks() Zhang Yi
2025-06-05 13:44   ` Jan Kara
2025-05-30  6:28 ` [PATCH 5/5] ext4: disable large folios if dioread_nolock is not enabled Zhang Yi

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).