[14/21] ext4: remove ac->ac_found > sbi->s_mb_min_to_scan dead check in ext4_mb_check_limits
Message ID | 20230209194825.511043-15-shikemeng@huaweicloud.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp289511wrn; Thu, 9 Feb 2023 03:59:16 -0800 (PST) X-Google-Smtp-Source: AK7set9r3GOj4adamCD/oDjuBl7lucvV8w39jy+RVWQCvdE4NlwOHVNubKRet7RrwirSaquByVlk X-Received: by 2002:a17:906:7247:b0:88c:a3f0:4e3f with SMTP id n7-20020a170906724700b0088ca3f04e3fmr12259055ejk.22.1675943956810; Thu, 09 Feb 2023 03:59:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675943956; cv=none; d=google.com; s=arc-20160816; b=mjVCQg+edU53+swfxp5oycelqRg8UPQNkZYq32rrIUacXO/tb5s9ZvQMK72N2GmYd9 xFonUoSwPhWLnz3Ddw4YJfJnE6G0N+r9LfTSH6JE//aaCRrhVux1bNsU6bPwnbPaYMkr RQ0gCNxSKBgwrwadhizkcdRUB9vmLO2GPw53Fdwz53saLAEnh9Hhumh1NZr6xR4/nJ2e nHeFjJoJpCwcKReQNQrleWEs0N0oBAbXYJlIvz50aXvvpafemfB2SzC5gY5yagLFiBXw 5KE+2j1G+zF9T4k9oZJK0ohBpzII30ieheJCsgzVWXvQiJ7YfXbY6J/7vmhTYHSPJIrE hj+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=LUQlOevBBL88yDd//Bydx/kS8xm4lM/iukd4LVBswmc=; b=cOWy6iZmK/HwRtyMxsb/3b41peRJRTD3p+n7syT1F+kq7QARqfWaW83ogO3YB6k08/ jDAxqW6ugxVnwyRv4LsEX6kXaOSyOElpwPjRs6if5Qo0JGpLksZC7ptbGB2Wpkyk15wO dd9oq0whJaaTW4iZnsQFJ6rqhRvGgEfJPfzsPkEsgToYH4Mn5uSX7R004Ie2MYNBsQcY STFM9cnbrGArDAjmItqTQrFtW5Jtp+OWSxo1agY+V519LeVUCWsowN9wxLvGlJfUQ/4G pTFANtXpORAEEDoZgEKT62MPd8XAQj5N7z7yp4WZjPQ8oqHRH/VHPw0AfItZ3ucxzYg4 SNoA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id fh10-20020a1709073a8a00b0088c2a3a6f9csi2203795ejc.199.2023.02.09.03.58.51; Thu, 09 Feb 2023 03:59:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230402AbjBIL5y (ORCPT <rfc822;ybw1215001957@gmail.com> + 99 others); Thu, 9 Feb 2023 06:57:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59010 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229952AbjBIL4P (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 9 Feb 2023 06:56:15 -0500 Received: from dggsgout11.his.huawei.com (dggsgout11.his.huawei.com [45.249.212.51]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A67C45C498; Thu, 9 Feb 2023 03:46:32 -0800 (PST) Received: from mail02.huawei.com (unknown [172.30.67.169]) by dggsgout11.his.huawei.com (SkyGuard) with ESMTP id 4PCFSg6Qshz4f3k5d; Thu, 9 Feb 2023 19:46:27 +0800 (CST) Received: from huaweicloud.com (unknown [10.175.124.27]) by APP4 (Coremail) with SMTP id gCh0CgAn3rEQ3eRjgb0tDQ--.53508S16; Thu, 09 Feb 2023 19:46:30 +0800 (CST) From: Kemeng Shi <shikemeng@huaweicloud.com> To: tytso@mit.edu, adilger.kernel@dilger.ca, jack@suse.cz Cc: linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 14/21] ext4: remove ac->ac_found > sbi->s_mb_min_to_scan dead check in ext4_mb_check_limits Date: Fri, 10 Feb 2023 03:48:18 +0800 Message-Id: <20230209194825.511043-15-shikemeng@huaweicloud.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20230209194825.511043-1-shikemeng@huaweicloud.com> References: <20230209194825.511043-1-shikemeng@huaweicloud.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: gCh0CgAn3rEQ3eRjgb0tDQ--.53508S16 X-Coremail-Antispam: 1UD129KBjvJXoW7KrW5tF1rZrW3CryUCr17Wrg_yoW8WF4rpF srCFyUW34xWr1a9wsrK3Z8W3WrKw4fKF1xJryS9r1rAF17X3yqka9xtFyUZF9Fyrs3Z3Z3 ZFyYqr4UGw4Ika7anT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUUBIb4IE77IF4wAFF20E14v26rWj6s0DM7CY07I20VC2zVCF04k2 6cxKx2IYs7xG6rWj6s0DM7CIcVAFz4kK6r1j6r18M280x2IEY4vEnII2IxkI6r1a6r45M2 8IrcIa0xkI8VA2jI8067AKxVWUAVCq3wA2048vs2IY020Ec7CjxVAFwI0_Xr0E3s1l8cAv FVAK0II2c7xJM28CjxkF64kEwVA0rcxSw2x7M28EF7xvwVC0I7IYx2IY67AKxVWDJVCq3w A2z4x0Y4vE2Ix0cI8IcVCY1x0267AKxVW8Jr0_Cr1UM28EF7xvwVC2z280aVAFwI0_GcCE 3s1l84ACjcxK6I8E87Iv6xkF7I0E14v26rxl6s0DM2AIxVAIcxkEcVAq07x20xvEncxIr2 1l5I8CrVACY4xI64kE6c02F40Ex7xfMcIj6xIIjxv20xvE14v26r1j6r18McIj6I8E87Iv 67AKxVWUJVW8JwAm72CE4IkC6x0Yz7v_Jr0_Gr1lF7xvr2IYc2Ij64vIr41l42xK82IYc2 Ij64vIr41l4I8I3I0E4IkC6x0Yz7v_Jr0_Gr1lx2IqxVAqx4xG67AKxVWUJVWUGwC20s02 6x8GjcxK67AKxVWUGVWUWwC2zVAF1VAY17CE14v26r126r1DMIIYrxkI7VAKI48JMIIF0x vE2Ix0cI8IcVAFwI0_Gr0_Xr1lIxAIcVC0I7IYx2IY6xkF7I0E14v26F4j6r4UJwCI42IY 6xAIw20EY4v20xvaj40_Jr0_JF4lIxAIcVC2z280aVAFwI0_Gr0_Cr1lIxAIcVC2z280aV CY1x0267AKxVW8JVW8JrUvcSsGvfC2KfnxnUUI43ZEXa7IU0TqcUUUUUU== X-CM-SenderInfo: 5vklyvpphqwq5kxd4v5lfo033gof0z/ X-CFilter-Loop: Reflected X-Spam-Status: No, score=0.0 required=5.0 tests=BAYES_00,DATE_IN_FUTURE_06_12, SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1757354610384178657?= X-GMAIL-MSGID: =?utf-8?q?1757354610384178657?= |
Series |
Some bugfix and cleanup to mballoc
|
|
Commit Message
Kemeng Shi
Feb. 9, 2023, 7:48 p.m. UTC
Only call trace of ext4_mb_check_limits is as following:
ext4_mb_complex_scan_group
ext4_mb_measure_extent
ext4_mb_check_limits(ac, e4b, 0);
ext4_mb_check_limits(ac, e4b, 1);
If the first ac->ac_found > sbi->s_mb_max_to_scan check in
ext4_mb_check_limits is met, we will set ac_status to
AC_STATUS_BREAK and call ext4_mb_try_best_found to try to use
ac->ac_b_ex.
If ext4_mb_try_best_found successes, then block allocation finishs,
the removed ac->ac_found > sbi->s_mb_min_to_scan check is not reachable.
If ext4_mb_try_best_found fails, then we set EXT4_MB_HINT_FIRST and
reset ac->ac_b_ex to retry block allocation. We will use any found
free extent in ext4_mb_measure_extent before reach the removed
ac->ac_found > sbi->s_mb_min_to_scan check.
In summary, the removed ac->ac_found > sbi->s_mb_min_to_scan check is
not reachable and we can remove that dead check.
Signed-off-by: Kemeng Shi <shikemeng@huaweicloud.com>
---
fs/ext4/mballoc.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
Comments
On Fri, Feb 10, 2023 at 03:48:18AM +0800, Kemeng Shi wrote: > Only call trace of ext4_mb_check_limits is as following: > ext4_mb_complex_scan_group > ext4_mb_measure_extent > ext4_mb_check_limits(ac, e4b, 0); > ext4_mb_check_limits(ac, e4b, 1); > > If the first ac->ac_found > sbi->s_mb_max_to_scan check in > ext4_mb_check_limits is met, we will set ac_status to > AC_STATUS_BREAK and call ext4_mb_try_best_found to try to use > ac->ac_b_ex. > If ext4_mb_try_best_found successes, then block allocation finishs, > the removed ac->ac_found > sbi->s_mb_min_to_scan check is not reachable. > If ext4_mb_try_best_found fails, then we set EXT4_MB_HINT_FIRST and > reset ac->ac_b_ex to retry block allocation. We will use any found > free extent in ext4_mb_measure_extent before reach the removed > ac->ac_found > sbi->s_mb_min_to_scan check. > In summary, the removed ac->ac_found > sbi->s_mb_min_to_scan check is > not reachable and we can remove that dead check. > > Signed-off-by: Kemeng Shi <shikemeng@huaweicloud.com> > --- > fs/ext4/mballoc.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c > index 0fdbf16ac180..e53f84de5018 100644 > --- a/fs/ext4/mballoc.c > +++ b/fs/ext4/mballoc.c > @@ -2039,8 +2039,7 @@ static void ext4_mb_check_limits(struct ext4_allocation_context *ac, > if (bex->fe_len < gex->fe_len) > return; > > - if ((finish_group || ac->ac_found > sbi->s_mb_min_to_scan) > - && bex->fe_group == e4b->bd_group) { > + 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) */ > -- > 2.30.0 > Feel free to add: Reviewed-by: Ojaswin Mujoo <ojaswin@linux.ibm.com>
diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c index 0fdbf16ac180..e53f84de5018 100644 --- a/fs/ext4/mballoc.c +++ b/fs/ext4/mballoc.c @@ -2039,8 +2039,7 @@ static void ext4_mb_check_limits(struct ext4_allocation_context *ac, if (bex->fe_len < gex->fe_len) return; - if ((finish_group || ac->ac_found > sbi->s_mb_min_to_scan) - && bex->fe_group == e4b->bd_group) { + 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) */