Skip to contentSkip to conversation

iomap: add dirty page control to iomap_zero_iter

PATCH Applied Chi Zhiling 3 participants 3 messages May 11

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 iomap: add dirty page control to iomap_zero_iter

From: Chi Zhiling <[email protected]>

This patch prepares the iomap framework for exFAT's upcoming migration to iomap. During testing of the exFAT iomap branch with xfstests generic/299 on a VM with 8GB RAM and a 40GB disk, system unresponsiveness was observed.

iomap_zero_iter() lacked dirty page throttling, which could cause memory pressure when exFAT's valid_size mechanism triggers large-scale zeroing operations during writes beyond valid_size.

Align iomap_zero_iter() with iomap_write_iter() by adding balance_dirty_pages_ratelimited() to throttle dirty page generation during large zeroing operations

---

v1:
https://lore.kernel.org/linux-fsdevel/[email protected]/T/#t

exFAT iomap migration:
https://lore.kernel.org/linux-fsdevel/[email protected]/

 fs/iomap/buffered-io.c | 2 ++
 1 file changed, 2 insertions(+)
fs/iomap/buffered-io.c +2 -0
index d7b648421a70..437a7c527c4a 100644
@@ -1543,6 +1543,8 @@ static int iomap_zero_iter(struct iomap_iter *iter, bool *did_zero,
 		size_t offset;
 		bool ret;
 
+		balance_dirty_pages_ratelimited(iter->inode->i_mapping);
+
 		bytes = min_t(u64, SIZE_MAX, bytes);
 		status = iomap_write_begin(iter, write_ops, &folio, &offset,
 				&bytes);
Signature · 1 line
2.43.0
maintainer Applied
#2 lore raw
In reply to Chi Zhiling
Quoted 9 lines · Chi Zhiling

This patch prepares the iomap framework for exFAT's upcoming migration to iomap. During testing of the exFAT iomap branch with xfstests generic/299 on a VM with 8GB RAM and a 40GB disk, system unresponsiveness was observed.

iomap_zero_iter() lacked dirty page throttling, which could cause memory pressure when exFAT's valid_size mechanism triggers large-scale zeroing operations during writes beyond valid_size.

[...]

Applied to the vfs-7.2.iomap branch of the vfs/vfs.git tree. Patches in the vfs-7.2.iomap branch should appear in linux-next soon.

Please report any outstanding bugs that were missed during review in a new review to the original patch series allowing us to drop it.

It's encouraged to provide Acked-bys and Reviewed-bys even though the patch has now been applied. If possible patch trailers will be updated.

Note that commit hashes shown below are subject to change due to rebase, trailer updates or similar. If in doubt, please check the listed branch.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git
branch: vfs-7.2.iomap

[1/1] iomap: add dirty page control to iomap_zero_iter

      https://git.kernel.org/vfs/vfs/c/ecf22101ba7a