]> git.baikalelectronics.ru Git - kernel.git/commit
ext4: skip non-loaded groups at cr=0/1 when scanning for good groups
authorAlex Zhuravlev <azhuravlev@whamcloud.com>
Sat, 20 Jun 2020 02:08:56 +0000 (22:08 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Thu, 6 Aug 2020 05:44:55 +0000 (01:44 -0400)
commit129e1aec90b185981655c7a63bb6621fe1c4334a
tree9d1bd02a84b1a0e707537842a59a4b64f68e0a07
parent558d9c9295bf15ed6b849f2fba2c3e9d7907799e
ext4: skip non-loaded groups at cr=0/1 when scanning for good groups

cr=0 is supposed to be an optimization to save CPU cycles, but if
buddy data (in memory) is not initialized then all this makes no sense
as we have to do sync IO taking a lot of cycles.  Also, at cr=0
mballoc doesn't choose any available chunk.  cr=1 also skips groups
using heuristic based on avg. fragment size.  It's more useful to skip
such groups and switch to cr=2 where groups will be scanned for
available chunks.  However, we always read the first block group in a
flex_bg so metadata blocks will get read into the first flex_bg if
possible.

Using sparse image and dm-slow virtual device of 120TB was
simulated, then the image was formatted and filled using debugfs to
mark ~85% of available space as busy.  mount process w/o the patch
couldn't complete in half an hour (according to vmstat it would take
~10-11 hours).  With the patch applied mount took ~20 seconds.

Lustre-bug-id: https://jira.whamcloud.com/browse/LU-12988
Signed-off-by: Alex Zhuravlev <azhuravlev@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Artem Blagodarenko <artem.blagodarenko@gmail.com>
fs/ext4/mballoc.c