]> git.baikalelectronics.ru Git - kernel.git/commit
ext4: reduce computation of overhead during resize
authorKiselev, Oleg <okiselev@amazon.com>
Wed, 20 Jul 2022 04:26:22 +0000 (04:26 +0000)
committerTheodore Ts'o <tytso@mit.edu>
Wed, 3 Aug 2022 03:56:25 +0000 (23:56 -0400)
commit095973e44a0957537c7f2e9d7d2db8262e11b3a6
tree94d40fc8ef5c8810c3dc1e94173a3a6e59926cd3
parent5186c87e32d850f5a451490ea5501124db789e45
ext4: reduce computation of overhead during resize

This patch avoids doing an O(n**2)-complexity walk through every flex group.
Instead, it uses the already computed overhead information for the newly
allocated space, and simply adds it to the previously calculated
overhead stored in the superblock.  This drastically reduces the time
taken to resize very large bigalloc filesystems (from 3+ hours for a
64TB fs down to milliseconds).

Signed-off-by: Oleg Kiselev <okiselev@amazon.com>
Link: https://lore.kernel.org/r/CE4F359F-4779-45E6-B6A9-8D67FDFF5AE2@amazon.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
fs/ext4/resize.c