diff options
author | Zhang Yi <yi.zhang@huawei.com> | 2025-07-07 22:08:08 +0800 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2025-07-13 23:41:51 -0400 |
commit | e2c4c49dee64ca2f42ad2958cbe1805de96b6732 (patch) | |
tree | 98717d178e033671abffb48449e125f97c5196d8 /tools/perf/scripts/python/task-analyzer.py | |
parent | 2bddafea3d0d85ee9ac3cf5ba9a4b2f2d2f50257 (diff) |
ext4: restart handle if credits are insufficient during allocating blocks
After large folios are supported on ext4, writing back a sufficiently
large and discontinuous folio may consume a significant number of
journal credits, placing considerable strain on the journal. For
example, in a 20GB filesystem with 1K block size and 1MB journal size,
writing back a 2MB folio could require thousands of credits in the
worst-case scenario (when each block is discontinuous and distributed
across different block groups), potentially exceeding the journal size.
This issue can also occur in ext4_write_begin() and ext4_page_mkwrite()
when delalloc is not enabled.
Fix this by ensuring that there are sufficient journal credits before
allocating an extent in mpage_map_one_extent() and
ext4_block_write_begin(). If there are not enough credits, return
-EAGAIN, exit the current mapping loop, restart a new handle and a new
transaction, and allocating blocks on this folio again in the next
iteration.
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-6-yi.zhang@huaweicloud.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'tools/perf/scripts/python/task-analyzer.py')
0 files changed, 0 insertions, 0 deletions