lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20231107094920.4056281-1-anssi.hannula@iki.fi>
Date:   Tue,  7 Nov 2023 11:46:53 +0200
From:   Anssi Hannula <anssi.hannula@....fi>
To:     linux-ext4@...r.kernel.org, Theodore Ts'o <tytso@....edu>
Subject: [PATCH e2fsprogs] 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@....fi>
---
 resize/resize2fs.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/resize/resize2fs.c b/resize/resize2fs.c
index 5eeb7d44..46540501 100644
--- a/resize/resize2fs.c
+++ b/resize/resize2fs.c
@@ -1863,7 +1863,6 @@ static errcode_t block_mover(ext2_resize_t rfs)
 			old_blk += c;
 			moved += c;
 			if (rfs->progress) {
-				io_channel_flush(fs->io);
 				retval = (rfs->progress)(rfs,
 						E2_RSZ_BLOCK_RELOC_PASS,
 						moved, to_move);
@@ -1871,9 +1870,10 @@ static errcode_t block_mover(ext2_resize_t rfs)
 					goto errout;
 			}
 		} while (size > 0);
-		io_channel_flush(fs->io);
 	}
 
+	io_channel_flush(fs->io);
+
 errout:
 	if (badblock_list) {
 		if (!retval && bb_modified)
-- 
2.41.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ