]> git.baikalelectronics.ru Git - kernel.git/commit
ext4: optimize the implementation of ext4_mb_good_group()
authorbrookxu <brookxu.cn@gmail.com>
Fri, 7 Aug 2020 14:01:39 +0000 (22:01 +0800)
committerTheodore Ts'o <tytso@mit.edu>
Tue, 18 Aug 2020 18:18:36 +0000 (14:18 -0400)
commitf92872f9e1ec2eff837a354a26585c7b61537de3
treee6b9c9d5f175906fcf8510e3aa8c09d917e4f2f5
parent4f8add758eb50301f2e0100a2a6dca5cb855aef1
ext4: optimize the implementation of ext4_mb_good_group()

It might be better to adjust the code in two places:
1. Determine whether grp is currupt or not should be placed first.
2. (cr<=2 && free <ac->ac_g_ex.fe_len)should may belong to the crx
   strategy, and it may be more appropriate to put it in the
   subsequent switch statement block. For cr1, cr2, the conditions
   in switch potentially realize the above judgment. For cr0, we
   should add (free <ac->ac_g_ex.fe_len) judgment, and then delete
   (free / fragments) >= ac->ac_g_ex.fe_len), because cr0 returns
   true by default.

Signed-off-by: Chunguang Xu <brookxu@tencent.com>
Reviewed-by: Andreas Dilger <adilger@dilger.ca>
Reviewed-by: Ritesh Harjani <riteshh@linux.ibm.com>
Link: https://lore.kernel.org/r/e20b2d8f-1154-adb7-3831-a9e11ba842e9@gmail.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
fs/ext4/mballoc.c