From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2817DC4361A for ; Thu, 3 Dec 2020 15:09:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CC89A2085B for ; Thu, 3 Dec 2020 15:09:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730804AbgLCPJb (ORCPT ); Thu, 3 Dec 2020 10:09:31 -0500 Received: from outgoing-auth-1.mit.edu ([18.9.28.11]:39421 "EHLO outgoing.mit.edu" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727037AbgLCPJb (ORCPT ); Thu, 3 Dec 2020 10:09:31 -0500 Received: from callcc.thunk.org (pool-72-74-133-215.bstnma.fios.verizon.net [72.74.133.215]) (authenticated bits=0) (User authenticated as tytso@ATHENA.MIT.EDU) by outgoing.mit.edu (8.14.7/8.12.4) with ESMTP id 0B3F8frj015037 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 3 Dec 2020 10:08:41 -0500 Received: by callcc.thunk.org (Postfix, from userid 15806) id 3596D420136; Thu, 3 Dec 2020 10:08:41 -0500 (EST) Date: Thu, 3 Dec 2020 10:08:41 -0500 From: "Theodore Y. Ts'o" To: Chunguang Xu Cc: adilger.kernel@dilger.ca, linux-ext4@vger.kernel.org Subject: Re: [PATCH RESEND 4/8] ext4: add the gdt block of meta_bg to system_zone Message-ID: <20201203150841.GM441757@mit.edu> References: <1604764698-4269-1-git-send-email-brookxu@tencent.com> <1604764698-4269-4-git-send-email-brookxu@tencent.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1604764698-4269-4-git-send-email-brookxu@tencent.com> Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Sat, Nov 07, 2020 at 11:58:14PM +0800, Chunguang Xu wrote: > From: Chunguang Xu > > In order to avoid poor search efficiency of system_zone, the > system only adds metadata of some sparse group to system_zone. > In the meta_bg scenario, the non-sparse group may contain gdt > blocks. Perhaps we should add these blocks to system_zone to > improve fault tolerance without significantly reducing system > performance. > @@ -226,13 +227,16 @@ int ext4_setup_system_zone(struct super_block *sb) > > for (i=0; i < ngroups; i++) { > cond_resched(); > - if (ext4_bg_has_super(sb, i) && > - ((i < 5) || ((i % flex_size) == 0))) { > - ret = add_system_zone(system_blks, > - ext4_group_first_block_no(sb, i), > - ext4_bg_num_gdb(sb, i) + 1, 0); > - if (ret) > - goto err; > + if ((i < 5) || ((i % flex_size) == 0)) { If we're going to do this, why not just drop the above conditional, and just always do this logic for all block groups? > + gd_blks = ext4_bg_has_super(sb, i) + > + ext4_bg_num_gdb(sb, i); > + if (gd_blks) { > + ret = add_system_zone(system_blks, > + ext4_group_first_block_no(sb, i), > + gd_blks, 0); > + if (ret) > + goto err; > + } - Ted