Received: by 2002:aa6:c429:0:b029:98:93ff:f56f with SMTP id g9csp411034lkq; Thu, 3 Dec 2020 07:10:26 -0800 (PST) X-Google-Smtp-Source: ABdhPJw28fvAHfwBlrDMmrPzuWeYlJtdWHMxo7NV8q/xNmdAOnHAOHOEttq/fKQ7IZ0E/B/D+0A8 X-Received: by 2002:a05:6402:22ab:: with SMTP id cx11mr3222374edb.98.1607008226065; Thu, 03 Dec 2020 07:10:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607008226; cv=none; d=google.com; s=arc-20160816; b=xR+Q86YKoscuJthw6+yX6njwO+e9Aub7DFsdHPhyqepM2jgJdDEFNSpfkmVpH8Ayel /J0F/A25nZwtgg8ilQEhjiTV+Prsfe7ONXPULF9o3gHHslpdOBOafQZk2+tY4E9jL4b1 ZJQKpjOvtbkZ6vdytZ3yYoRuOlJesmAEUMV+OVNQ9FN/dDGZq6inHOax5/+aqnD9n6A8 xjx2uo1nusAoQjJIWXMiNugxQchrPcZX38CCN5noXMOFzuvLEpOL0bJIYdCt/6uCQW4D bZ6LwRu5mDWXTZQFh7teKPGWcBdDoM9Yfw75zdXeQ+8C0b9oO8yYUFM73qyiau+G4J4r 94QQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=uizDAtDRZmPQQf/s1hiy5zIsiTvS0FpjWDJHy7hV5Os=; b=SA3YIbOByLeavXe+SZuwPUCFQWC2KIuRT0ebGtGjDYrJnBSD9swI/AKef8Vj7LXjRB tyMMAGT6WVJJ3hmT9xxPC7okP8kGFC/Ve7qTphvNsIWWOotKmzgUshaB/W4fcM2bNldy qhRf+e0OoreXwiAGjddVpctLtDTQjdYYlVKBztfH/5mhwbhPMOdoDssivCqxw1MU0yMw I9xCJLSKuZOvPmiM/6pq9UZ3ceG3rBnrUAgJZJdXU7W1xmsOmDNY/C74j+YQblge50P1 CFnlS15COih/wogplo0Fj0boJ68v87dzq+7dEYjpbQMciPcZxX9j6awBqva/VKqU82Yu +ZIg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g12si1089788edw.160.2020.12.03.07.09.50; Thu, 03 Dec 2020 07:10:26 -0800 (PST) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729954AbgLCPJb (ORCPT + 99 others); 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