]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ext4: reserved credits for one extent during the folio writeback
authorZhang Yi <yi.zhang@huawei.com>
Mon, 7 Jul 2025 14:08:11 +0000 (22:08 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 23 Aug 2025 14:49:41 +0000 (16:49 +0200)
commit2e8216e289d02985baf810f7b09fbf5a10defbd6
tree856786e6d71b7e81f60bae3cf633164f67d92fcc
parent2b6d39229bc783198222cddd31e2fbded93c8db7
ext4: reserved credits for one extent during the folio writeback

commit bbbf150f3f85619569ac19dc6458cca7c492e715 upstream.

After ext4 supports large folios, reserving journal credits for one
maximum-ordered folio based on the worst case cenario during the
writeback process can easily exceed the maximum transaction credits.
Additionally, reserving journal credits for one page is also no
longer appropriate.

Currently, the folio writeback process can either extend the journal
credits or initiate a new transaction if the currently reserved journal
credits are insufficient. Therefore, it can be modified to reserve
credits for only one extent at the outset. In most cases involving
continuous mapping, these credits are generally adequate, and we may
only need to perform some basic credit expansion. However, in extreme
cases where the block size and folio size differ significantly, or when
the folios are sufficiently discontinuous, it may be necessary to
restart a new transaction and resubmit the folios.

Suggested-by: Jan Kara <jack@suse.cz>
Signed-off-by: Zhang Yi <yi.zhang@huawei.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Link: https://patch.msgid.link/20250707140814.542883-9-yi.zhang@huaweicloud.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/ext4/inode.c