Message ID | 20230303172120.3800725-15-shikemeng@huaweicloud.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp307512wrd; Fri, 3 Mar 2023 01:21:19 -0800 (PST) X-Google-Smtp-Source: AK7set/FI9LZ9tL9zJBWsIKEwht0zdH3itMXl0kvOCvjCf6Kt8/0AYyPZPWGnwJcpyfr0UFfzkYe X-Received: by 2002:a05:6a21:32a2:b0:cb:8d74:112e with SMTP id yt34-20020a056a2132a200b000cb8d74112emr1424714pzb.45.1677835279574; Fri, 03 Mar 2023 01:21:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677835279; cv=none; d=google.com; s=arc-20160816; b=m0GUKJl8gChQGxkbHKJsZzEzxiiDL/JPziC843w0RGgQfgCD4xJ0l7mskRZL+JxfaC YPnRD5pMR+PgY9ttJHsQaVCUABu/ANSw0q/nu94GX3dfppd+UXKnDC+ZPxxAt6/6zk8M QgD/IrxW57zwQ9ZoALAOem54bI6ltc9uPTTw6WzBT7Xuwibse+iWq7w3QUQr4DFwOBHy ZP7HNnz0iyiXLMLsfr/gVrpO07PuHzYD9/11EvQzE1TKLYrLSiYEH6a/3PgiuLQMPYAi XztmpwjMAa0G5D3gHE3/+Z2+qIiTIBu2rdRH/JIGahOctU9zLPCgyvspTa/LWhgSxpdJ Ab/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=u5q2PYQCR0bvgqmqs204Ah0fqnh4dhlzhJfyx6xnt1E=; b=qlGFR4Jv4M9aRd7tKavaOWJ/XJz9wIBiX6BmF3MQH7NZ3YWtVyYRKfXoP5/IfFLkHS xZemwUQ8VNGSvInQqQoDuLksV+QzJYBE5b6o8mCp9hdmt+mOIuEuRCfk6lnSbkxIeE0K 0utJDx2/e6zsO+2tXrmR9djYJKd7ZOCmA7cWHcHF/utdJOYaLG4rWYgs6F2Es0JXj9ZB 5Hk35dc+FG/Gq2PwzbhnLnOXDnyhBZRiAy1zXRVTAkSpmq51degFI4agVGdniyMxOze/ 4847+gBLJ7zMr7noPN26bEWJ+KW/scWILfWliuKj7hbp/jfbDKraxOjurkTHXyqLfR3L WXVw== 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 x5-20020a63cc05000000b004fbd1d7f430si1713854pgf.46.2023.03.03.01.21.07; Fri, 03 Mar 2023 01:21:19 -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 S230478AbjCCJUl (ORCPT <rfc822;davidbtadokoro@gmail.com> + 99 others); Fri, 3 Mar 2023 04:20:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49908 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230088AbjCCJT4 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 3 Mar 2023 04:19:56 -0500 Received: from dggsgout11.his.huawei.com (dggsgout11.his.huawei.com [45.249.212.51]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 97DFD3A853; Fri, 3 Mar 2023 01:19:55 -0800 (PST) Received: from mail02.huawei.com (unknown [172.30.67.153]) by dggsgout11.his.huawei.com (SkyGuard) with ESMTP id 4PSj9M1Vnbz4f3nVF; Fri, 3 Mar 2023 17:19:51 +0800 (CST) Received: from huaweicloud.com (unknown [10.175.124.27]) by APP4 (Coremail) with SMTP id gCh0CgDnnbGyuwFkFpqfEg--.45687S16; Fri, 03 Mar 2023 17:19:52 +0800 (CST) From: Kemeng Shi <shikemeng@huaweicloud.com> To: tytso@mit.edu, adilger.kernel@dilger.ca, ojaswin@linux.ibm.com, ritesh.list@gmail.com Cc: linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org, shikemeng@huaweicloud.com Subject: [PATCH v3 14/20] ext4: use best found when complex scan of group finishs Date: Sat, 4 Mar 2023 01:21:14 +0800 Message-Id: <20230303172120.3800725-15-shikemeng@huaweicloud.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20230303172120.3800725-1-shikemeng@huaweicloud.com> References: <20230303172120.3800725-1-shikemeng@huaweicloud.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: gCh0CgDnnbGyuwFkFpqfEg--.45687S16 X-Coremail-Antispam: 1UD129KBjvJXoW7WF17WrW5CFyDWF17tr1rtFb_yoW8GFWkpF s3JF1UuryfXrn8uw42ka1aq3WrKw4I9r1IyrWIgw18WFy2v39Y9anrtry09FykJrZ5AF98 Zr1YvF4UGw47Ka7anT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUUPI14x267AKxVWrJVCq3wAFc2x0x2IEx4CE42xK8VAvwI8IcIk0 rVWrJVCq3wAFIxvE14AKwVWUJVWUGwA2jI8I6cxK62vIxIIY0VWUZVW8XwA2048vs2IY02 0E87I2jVAFwI0_JF0E3s1l82xGYIkIc2x26xkF7I0E14v26ryj6s0DM28lY4IEw2IIxxk0 rwA2F7IY1VAKz4vEj48ve4kI8wA2z4x0Y4vE2Ix0cI8IcVAFwI0_tr0E3s1l84ACjcxK6x IIjxv20xvEc7CjxVAFwI0_Gr1j6F4UJwA2z4x0Y4vEx4A2jsIE14v26rxl6s0DM28EF7xv wVC2z280aVCY1x0267AKxVW0oVCq3wAS0I0E0xvYzxvE52x082IY62kv0487Mc02F40EFc xC0VAKzVAqx4xG6I80ewAv7VC0I7IYx2IY67AKxVWUJVWUGwAv7VC2z280aVAFwI0_Jr0_ Gr1lOx8S6xCaFVCjc4AY6r1j6r4UM4x0Y48IcxkI7VAKI48JM4x0x7Aq67IIx4CEVc8vx2 IErcIFxwCF04k20xvY0x0EwIxGrwCFx2IqxVCFs4IE7xkEbVWUJVW8JwC20s026c02F40E 14v26r1j6r18MI8I3I0E7480Y4vE14v26r106r1rMI8E67AF67kF1VAFwI0_JF0_Jw1lIx kGc2Ij64vIr41lIxAIcVC0I7IYx2IY67AKxVW8JVW5JwCI42IY6xIIjxv20xvEc7CjxVAF wI0_Gr1j6F4UJwCI42IY6xAIw20EY4v20xvaj40_Jr0_JF4lIxAIcVC2z280aVAFwI0_Gr 0_Cr1lIxAIcVC2z280aVCY1x0267AKxVW8Jr0_Cr1UYxBIdaVFxhVjvjDU0xZFpf9x0pRv JPtUUUUU= 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?1759337806300165433?= X-GMAIL-MSGID: =?utf-8?q?1759337806300165433?= |
Series |
Some bugfix and cleanup to mballoc
|
|
Commit Message
Kemeng Shi
March 3, 2023, 5:21 p.m. UTC
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> --- fs/ext4/mballoc.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-)
diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c index 5315c67905f6..60b39fba2fce 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); } /*