diff options
author | Kemeng Shi <shikemeng@huaweicloud.com> | 2023-03-03 20:21:14 +0300 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2023-04-06 08:13:11 +0300 |
commit | 78dc9f844f4ec999a30517313040948a4c4bbc00 (patch) | |
tree | 21098ac66b583da357942af93640d77e0b923f09 /fs/ext4/mballoc.c | |
parent | 32c0869370194ae5ac9f9f501953ef693040f6a1 (diff) | |
download | linux-78dc9f844f4ec999a30517313040948a4c4bbc00.tar.xz |
ext4: use best found when complex scan of group finishs
If any bex which meets bex->fe_len >= gex->fe_len is found, then it will
always be used when complex scan of group that bex belongs to finishs.
So there will not be any lock-unlock period.
Signed-off-by: Kemeng Shi <shikemeng@huaweicloud.com>
Reviewed-by: Ojaswin Mujoo <ojaswin@linux.ibm.com>
Link: https://lore.kernel.org/r/20230303172120.3800725-15-shikemeng@huaweicloud.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/mballoc.c')
-rw-r--r-- | fs/ext4/mballoc.c | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c index eeafa1bba824..a12c33bc2756 100644 --- a/fs/ext4/mballoc.c +++ b/fs/ext4/mballoc.c @@ -2019,8 +2019,6 @@ static void ext4_mb_check_limits(struct ext4_allocation_context *ac, struct ext4_sb_info *sbi = EXT4_SB(ac->ac_sb); struct ext4_free_extent *bex = &ac->ac_b_ex; struct ext4_free_extent *gex = &ac->ac_g_ex; - struct ext4_free_extent ex; - int max; if (ac->ac_status == AC_STATUS_FOUND) return; @@ -2039,16 +2037,8 @@ static void ext4_mb_check_limits(struct ext4_allocation_context *ac, if (bex->fe_len < gex->fe_len) return; - if (finish_group && bex->fe_group == e4b->bd_group) { - /* recheck chunk's availability - we don't know - * when it was found (within this lock-unlock - * period or not) */ - max = mb_find_extent(e4b, bex->fe_start, gex->fe_len, &ex); - if (max >= gex->fe_len) { - ext4_mb_use_best_found(ac, e4b); - return; - } - } + if (finish_group) + ext4_mb_use_best_found(ac, e4b); } /* |