Whamcloud - gitweb
resize2fs: avoid constantly flushing while moving blocks
authorAnssi Hannula <anssi.hannula@iki.fi>
Tue, 7 Nov 2023 09:46:53 +0000 (11:46 +0200)
committerTheodore Ts'o <tytso@mit.edu>
Wed, 17 Apr 2024 04:04:24 +0000 (00:04 -0400)
commite0e6b13d0ea7330234a6fe51ec3ba13ef884735e
tree232342342e75b3785158b834d6f15d56e4fd01f2
parent187ba4f31537cf926cbd9849ee6848c9251ff8e5
resize2fs: avoid constantly flushing while moving blocks

resize2fs block_mover() flushes data after each extent and, curiously,
only if progress indicator is enabled, every inode_blocks_per_group
blocks.

This significantly affects performance, e.g. on a tested large
filesystem on top of MD-RAID6+LVM+dm-crypt these flush calls reduce the
operation rate from approx. 500MB/s to 5MB/s, causing extremely long
shrinking times for large size deltas (70TB in my case).

Since this step performs just plain data copying and does not e.g. save
any progress/checkpoint information or similar metadata, it seems like
this flushing is of very limited usefulness, especially when considering
the (in some cases) 100x performance impact.

Remove the mid-operation flushes and only flush after all blocks have
been moved.

Signed-off-by: Anssi Hannula <anssi.hannula@iki.fi>
Link: https://lore.kernel.org/r/20231107094920.4056281-1-anssi.hannula@iki.fi
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
resize/resize2fs.c