Message ID | 20230303172120.3800725-1-shikemeng@huaweicloud.com |
---|---|
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 v21csp307420wrd; Fri, 3 Mar 2023 01:21:03 -0800 (PST) X-Google-Smtp-Source: AK7set8MDayvdlM4hb1tbCSuU5JNbZllo+d+m4LxY1zXOUdv3+mkR20t/bpxHtG72Cjf+rxRLAw4 X-Received: by 2002:a05:6402:2d3:b0:4c3:15f0:1100 with SMTP id b19-20020a05640202d300b004c315f01100mr1172472edx.29.1677835262853; Fri, 03 Mar 2023 01:21:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677835262; cv=none; d=google.com; s=arc-20160816; b=wgnVOt3SzN1OOvoxxu7r30Paf+BGESGOJ1H7zms70PiBX84az6bGT3K3hJF9KuATWM YwiiHwXMIlMAJ4WBkqpiwC5Eq8YlBoQIOPVn1NIFjPEEoMmahgl6Q71BcbJsZyXBgQQK to0CpSLS70RZiSGytRc//+x8LRylnBWjmtDE6LRwVm3lPwCK6sZtLvofIyagDxvsTNUB 1Vae2+QVyFyCO24/evt0FeX5ALvmlAAQlbKVq2/b3wfqEXBAszs1RSgTlRV9CzG9sAGq BCYuaYp3joZmfCQHBvkEU/oMN9KvXOr0NxKU0zJkBxXFTzU9AzZNmbp/ISB2xvKAXitO Fo4w== 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 :message-id:date:subject:cc:to:from; bh=L5J3cy7OVm/1/BZeUnsu64DHIE4Ww4zL2JEl5Exgf/w=; b=FOzKkxPVrLIjIDGpX3S5zhC/n4YTw2OEooCs4jwaRAfzo6ngf1moRz5m4EJpUUkuaM pihRsK9NAdMYpar5zVBKq3hzSHWu9HnyrGXiVNQdAQSb7aYppm8JxTAaJaJfGzfGnq9j k1qA2ljU0D+Iv2lhxCcf1LkDm6CsxRFT2pSgxur4K/MlHJ97PxBf/XERSCpkZsctLoam bqHwpm80UxDg9zUnWnULwK0lf+3weS7tL/Np9KL/WMOpDmVlzhYx7I8/fWkK+37tseB0 M3HpK0d1QFlqcQWTrugLNh1dy/QMFn3Z98VpnwV/LyJ7eGVPNGTK7WZEbMUSt55vVeEe d4TA== 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 s4-20020a170906284400b008e2fcb91f89si1864233ejc.152.2023.03.03.01.20.39; Fri, 03 Mar 2023 01:21:02 -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 S230287AbjCCJUS (ORCPT <rfc822;davidbtadokoro@gmail.com> + 99 others); Fri, 3 Mar 2023 04:20:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49778 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229928AbjCCJTw (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 3 Mar 2023 04:19:52 -0500 Received: from dggsgout11.his.huawei.com (dggsgout11.his.huawei.com [45.249.212.51]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 27DADDBDB; Fri, 3 Mar 2023 01:19:51 -0800 (PST) Received: from mail02.huawei.com (unknown [172.30.67.153]) by dggsgout11.his.huawei.com (SkyGuard) with ESMTP id 4PSj9G2pD6z4f3jJ8; Fri, 3 Mar 2023 17:19:46 +0800 (CST) Received: from huaweicloud.com (unknown [10.175.124.27]) by APP4 (Coremail) with SMTP id gCh0CgDnnbGyuwFkFpqfEg--.45687S2; Fri, 03 Mar 2023 17:19:48 +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 00/20] Some bugfix and cleanup to mballoc Date: Sat, 4 Mar 2023 01:21:00 +0800 Message-Id: <20230303172120.3800725-1-shikemeng@huaweicloud.com> X-Mailer: git-send-email 2.30.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: gCh0CgDnnbGyuwFkFpqfEg--.45687S2 X-Coremail-Antispam: 1UD129KBjvJXoWxXr4kCFWDur4kXw1fAw4rGrg_yoW5Wr1kpF 43GwnIk34xXr12kFZxuw45X3WfJ3y8Cw1UGFyIg348Ar13Ar9aqrnrKF1ruFW5JrWvq3Zx ZFW2yry3Gw4kAa7anT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUUv014x267AKxVW8JVW5JwAFc2x0x2IEx4CE42xK8VAvwI8IcIk0 rVWrJVCq3wAFIxvE14AKwVWUJVWUGwA2jI8I6cxK62vIxIIY0VWUZVW8XwA2ocxC64kIII 0Yj41l84x0c7CEw4AK67xGY2AK021l84ACjcxK6xIIjxv20xvE14v26w1j6s0DM28EF7xv wVC0I7IYx2IY6xkF7I0E14v26r4UJVWxJr1l84ACjcxK6I8E87Iv67AKxVW0oVCq3wA2z4 x0Y4vEx4A2jsIEc7CjxVAFwI0_GcCE3s1le2I262IYc4CY6c8Ij28IcVAaY2xG8wAqx4xG 64xvF2IEw4CE5I8CrVC2j2WlYx0E2Ix0cI8IcVAFwI0_Jr0_Jr4lYx0Ex4A2jsIE14v26r 1j6r4UMcvjeVCFs4IE7xkEbVWUJVW8JwACjcxG0xvY0x0EwIxGrwACjI8F5VA0II8E6IAq YI8I648v4I1l42xK82IYc2Ij64vIr41l4I8I3I0E4IkC6x0Yz7v_Jr0_Gr1lx2IqxVAqx4 xG67AKxVWUJVWUGwC20s026x8GjcxK67AKxVWUGVWUWwC2zVAF1VAY17CE14v26r126r1D MIIYrxkI7VAKI48JMIIF0xvE2Ix0cI8IcVAFwI0_Jr0_JF4lIxAIcVC0I7IYx2IY6xkF7I 0E14v26r1j6r4UMIIF0xvE42xK8VAvwI8IcIk0rVWrZr1j6s0DMIIF0xvEx4A2jsIE14v2 6r1j6r4UMIIF0xvEx4A2jsIEc7CjxVAFwI0_Jr0_GrUvcSsGvfC2KfnxnUUI43ZEXa7sRi Pl1DUUUUU== 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?1759337788392384580?= X-GMAIL-MSGID: =?utf-8?q?1759337788392384580?= |
Series |
Some bugfix and cleanup to mballoc
|
|
Message
Kemeng Shi
March 3, 2023, 5:21 p.m. UTC
Hi, this series contain some random cleanup patches and some bugfix patches to make EXT4_MB_HINT_GOAL_ONLY work properly, protect pa->pa_free from race and so on. More details can be found in git log. Thanks! --- V3: -patch 01/20 "ext4: set goal start correctly in ext4_mb_normalize_request" correctly record goal in ac_g_ex instead of ac_f_ex, this also trigger another original bug that wanted goal maybe out of valid data block range. Add valid range check in patch 01/20 to fully fix the bug. -run "kvm-xfstests smoke" and all tests are passed except generic/454. This test also failed in running kernel without this patchset, so it's unlikely caused by this patchset. I'm trying to figure out the reason but it may take a while as I'm not family with kvm-xfstests. Just send this series for early review and maybe some help to pass the failed test case. --- V2: -Add signed-off from Ritesh and Ojaswin to patch 3/20 "ext4: get correct ext4_group_info in ext4_mb_prefetch_fini" as this is a duplicate of a patch under reviewing. -Split out original patch "ext4: avoid to use preallocated blocks if EXT4_MB_HINT_GOAL_ONLY is set" which will be resend after improved. -Improve log information of patch 20. -Collect Reviewed-by from Ojaswin and Ritesh. Now only patch 3, 12 and 20 need futher review. --- Kemeng Shi (20): ext4: set goal start correctly in ext4_mb_normalize_request ext4: allow to find by goal if EXT4_MB_HINT_GOAL_ONLY is set ext4: get correct ext4_group_info in ext4_mb_prefetch_fini ext4: correct calculation of s_mb_preallocated ext4: correct start of used group pa for debug in ext4_mb_use_group_pa ext4: protect pa->pa_free in ext4_discard_allocated_blocks ext4: add missed brelse in ext4_free_blocks_simple ext4: remove unused return value of ext4_mb_try_best_found and ext4_mb_free_metadata ext4: Remove unnecessary release when memory allocation failed in ext4_mb_init_cache ext4: remove unnecessary e4b->bd_buddy_page check in ext4_mb_load_buddy_gfp ext4: remove unnecessary check in ext4_mb_new_blocks ext4: remove dead check in mb_buddy_mark_free ext4: remove ac->ac_found > sbi->s_mb_min_to_scan dead check in ext4_mb_check_limits ext4: use best found when complex scan of group finishs ext4: remove unnecessary exit_meta_group_info tag ext4: remove unnecessary count2 in ext4_free_data_in_buddy ext4: remove unnecessary goto in ext4_mb_mark_diskspace_used ext4: remove repeat assignment to ac_f_ex ext4: remove comment code ext4_discard_preallocations ext4: simplify calculation of blkoff in ext4_mb_new_blocks_simple fs/ext4/mballoc.c | 111 ++++++++++++++++++---------------------------- 1 file changed, 43 insertions(+), 68 deletions(-)
Comments
on 3/4/2023 1:21 AM, Kemeng Shi wrote: > Hi, this series contain some random cleanup patches and some bugfix > patches to make EXT4_MB_HINT_GOAL_ONLY work properly, protect pa->pa_free > from race and so on. More details can be found in git log. > Thanks! > > --- > V3: > -patch 01/20 "ext4: set goal start correctly in > ext4_mb_normalize_request" correctly record goal in ac_g_ex instead of > ac_f_ex, this also trigger another original bug that wanted goal maybe > out of valid data block range. Add valid range check in patch 01/20 > to fully fix the bug. > -run "kvm-xfstests smoke" and all tests are passed except generic/454. > This test also failed in running kernel without this patchset, so > it's unlikely caused by this patchset. I'm trying to figure out the > reason but it may take a while as I'm not family with kvm-xfstests. > Just send this series for early review and maybe some help to pass > the failed test case. I re-run "kvm-xfstests smoke" with newly root_fs.img and all tests pass. It may be the early test which triggerred bug and corruptted the metadata casues failure. > --- > V2: > -Add signed-off from Ritesh and Ojaswin to patch 3/20 "ext4: get correct > ext4_group_info in ext4_mb_prefetch_fini" as this is a duplicate of > a patch under reviewing. > -Split out original patch "ext4: avoid to use preallocated blocks if > EXT4_MB_HINT_GOAL_ONLY is set" which will be resend after improved. > -Improve log information of patch 20. > -Collect Reviewed-by from Ojaswin and Ritesh. Now only patch 3, 12 and > 20 need futher review. > --- > > > Kemeng Shi (20): > ext4: set goal start correctly in ext4_mb_normalize_request > ext4: allow to find by goal if EXT4_MB_HINT_GOAL_ONLY is set > ext4: get correct ext4_group_info in ext4_mb_prefetch_fini > ext4: correct calculation of s_mb_preallocated > ext4: correct start of used group pa for debug in ext4_mb_use_group_pa > ext4: protect pa->pa_free in ext4_discard_allocated_blocks > ext4: add missed brelse in ext4_free_blocks_simple > ext4: remove unused return value of ext4_mb_try_best_found and > ext4_mb_free_metadata > ext4: Remove unnecessary release when memory allocation failed in > ext4_mb_init_cache > ext4: remove unnecessary e4b->bd_buddy_page check in > ext4_mb_load_buddy_gfp > ext4: remove unnecessary check in ext4_mb_new_blocks > ext4: remove dead check in mb_buddy_mark_free > ext4: remove ac->ac_found > sbi->s_mb_min_to_scan dead check in > ext4_mb_check_limits > ext4: use best found when complex scan of group finishs > ext4: remove unnecessary exit_meta_group_info tag > ext4: remove unnecessary count2 in ext4_free_data_in_buddy > ext4: remove unnecessary goto in ext4_mb_mark_diskspace_used > ext4: remove repeat assignment to ac_f_ex > ext4: remove comment code ext4_discard_preallocations > ext4: simplify calculation of blkoff in ext4_mb_new_blocks_simple > > fs/ext4/mballoc.c | 111 ++++++++++++++++++---------------------------- > 1 file changed, 43 insertions(+), 68 deletions(-) >
On Sat, 4 Mar 2023 01:21:00 +0800, Kemeng Shi wrote: > patches to make EXT4_MB_HINT_GOAL_ONLY work properly, protect pa->pa_free > from race and so on. More details can be found in git log. > Thanks! > Applied, thanks! [01/20] ext4: set goal start correctly in ext4_mb_normalize_request commit: 98860659740354352783cb55c8443e0e46e0978c [02/20] ext4: allow to find by goal if EXT4_MB_HINT_GOAL_ONLY is set commit: cace8c0f41382effffa8a14cfc4666a5ae171d03 [03/20] ext4: get correct ext4_group_info in ext4_mb_prefetch_fini commit: 36a366185c1c733ce43e8d6d8ca43997c5b601ce [04/20] ext4: correct calculation of s_mb_preallocated commit: a53b8e3f47d790cb8b520b89b59cf0b65aee7e38 [05/20] ext4: correct start of used group pa for debug in ext4_mb_use_group_pa commit: 043a9c31c51a26c5926fd62bdd9d7a057cc4acd1 [06/20] ext4: protect pa->pa_free in ext4_discard_allocated_blocks commit: 5ddfc1b03d405d2890dc75eee6e1659c0e022407 [07/20] ext4: add missed brelse in ext4_free_blocks_simple commit: a8735a61d23ce9f91c965041eb3ff2a8501853f2 [08/20] ext4: remove unused return value of ext4_mb_try_best_found and ext4_mb_free_metadata commit: 1104c3ce5375bbc1229a8e56f7ac84e23953b887 [09/20] ext4: Remove unnecessary release when memory allocation failed in ext4_mb_init_cache commit: d5e46843e6db39ae386dd7c728861caca3bb0e6e [10/20] ext4: remove unnecessary e4b->bd_buddy_page check in ext4_mb_load_buddy_gfp commit: d53c2664698f218acd8ce8848427be4da039dee9 [11/20] ext4: remove unnecessary check in ext4_mb_new_blocks commit: 4e91261632b0b1d0dee4a9bd99ac70d49d35ebc5 [12/20] ext4: remove dead check in mb_buddy_mark_free commit: 0b6d4554bdc97d40692abf05a0f087656acfa876 [13/20] ext4: remove ac->ac_found > sbi->s_mb_min_to_scan dead check in ext4_mb_check_limits commit: 38121fdf014cbd631e83fe9aa20a93a57670c2fe [14/20] ext4: use best found when complex scan of group finishs commit: be52c043d5d18d23605980c3485ae41de19cc99c [15/20] ext4: remove unnecessary exit_meta_group_info tag commit: 1a5500baa0235477ac6eef76d75c70540522e886 [16/20] ext4: remove unnecessary count2 in ext4_free_data_in_buddy commit: 8df82ffee909b633f727414a4b50c2638de9c3d4 [17/20] ext4: remove unnecessary goto in ext4_mb_mark_diskspace_used commit: 101cbefae32efa89e717c89919a9164c4ea2b0a5 [18/20] ext4: remove repeat assignment to ac_f_ex commit: b9a0763df46aaa1d7c33859e24ff0ebd4fea009c [19/20] ext4: remove comment code ext4_discard_preallocations commit: e0057b7ceade573f52a51a5bce75de8a1abe60b0 [20/20] ext4: simplify calculation of blkoff in ext4_mb_new_blocks_simple commit: 7bb392f6f9c465182aea60cc55287595bf28f866 Best regards,