Skip to content

Make filesystem shrinking faster and less CPU-intensive

Sami Liedes linux-ext4 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 of 5 patches 13 repliesIn review

3 of 5 patches are in this archive. The cover letter announces 5.

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
3/5libext2fs: Document EXT2_FLAG_64BITS in ext2fs_open2().lib/ext2fs/openfs.c+1 -00 replies
4/5libext2fs: Implement ext2fs_find_first_zero_generic_bmap().lib/ext2fs/alloc.c lib/ext2fs/bitops.h lib/ext2fs/bmap64.h +1 more+66 -57 replies
5/5libext2fs: Implement fast find_first_zero() for bitarray bitmaps.lib/ext2fs/blkmap64_ba.c+81 -03 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/5] Make filesystem shrinking faster and less CPU-intensive

This patch set speeds up at least resize2fs shrinking by causing its CPU usage to drop by 99.5% by optimizing inode bitfield scanning.

Test case: A 100G ext4 filesystem filled to 50% with copies of /usr/share/doc, shrinking to 75G on a slow disk (~5400 rpm) and fast processor (Core i7):

Before:

# time resize2fs -p $FILESYSTEM 75G
[...]
real    96m26.852s
user    56m39.768s
sys     0m27.922s

After:

# time resize2fs -p $FILESYSTEM 75G
real    39m49.287s
user    0m16.601s
sys     0m26.606s

Sami Liedes (5):
libext2fs: Move a modulo operation out of a hot loop.
resize2fs: Use EXT2_FLAG_64BITS.
libext2fs: Document EXT2_FLAG_64BITS in ext2fs_open2().
libext2fs: Implement ext2fs_find_first_zero_generic_bmap().
libext2fs: Implement fast find_first_zero() for bitarray bitmaps.

 lib/ext2fs/alloc.c        |   27 +++------------
 lib/ext2fs/bitops.h       |   16 ---------
 lib/ext2fs/blkmap64_ba.c  |   81 ---------------------------------------------
 lib/ext2fs/bmap64.h       |    5 ---
 lib/ext2fs/gen_bitmap64.c |   28 ---------------
 lib/ext2fs/openfs.c       |    1 -
 resize/main.c             |    3 --
 7 files changed, 5 insertions(+), 156 deletions(-)