Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp3697106pxu; Tue, 8 Dec 2020 20:37:42 -0800 (PST) X-Google-Smtp-Source: ABdhPJzQv7VZmbNtb7QM7hxVHXp689IRsOQqRnwWJUtH9Sex7db/hZBcKh6SJCGkhaBKPzcLqVfW X-Received: by 2002:a17:906:76cd:: with SMTP id q13mr52513ejn.67.1607488661903; Tue, 08 Dec 2020 20:37:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607488661; cv=none; d=google.com; s=arc-20160816; b=R0iuozazUK4mJp39aMUbWd+oO9EF14e7tzWNmaRZRmvm9BUNr/k95lArI4TUKlA+oW cZCFIJ7Rf4BLWAXimQb3slgqX2EANHfJ4AuRN3e+iskYgz8ybLFQrRe9oBXE4N0ZG3it /VCm1t9HDGEYDjxU36Sh5DVyB0q9FLwVAyV9VFzHbv60pKj0Ijo+W5jqO8MbPEX2X4Jq oBERZwdRV39qIZH6bQKo5x/fXtXW+0Ek3dzL6warnxj+yAmlCMArOOsVQkczpHsOfmle ZY4gsYsLzYE2W44e5bwmVcqJxwQBWrcfxeIiCo5prgDH7LMrmiSYYy95kIQV3AGqNzfo sO4g== 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=bkCBMe2N4ZALJVbIePzLrBxWGfCOzrVtWPYj0M40nhE=; b=eawQs2QMIiAIBPsKvjw39/fzJGtMr9LWEvp9W5V+t44wG/c2AkFIGGLq1HsApXB+R+ w34SzZsbGXSfBUyizjr1WdhGke55AVbOHSG2ZzqG1V1ZC2sw4M/z5olzPG9JXLfM+Vqu 4Upow1/DtH5KtFrOIPfW8zs1sLhx0Ohq2pW7ZpRI0awMJilz3pCVE9vw4IOeJ5zfqypO G7YHvrl7+SP7Gi45avAfFORxVlmjnEsi0pIXIWp4g0wKkbjx1Out+HdRwr22M77WG/Au nU/mUhsxkVfJUGvO63iU7jcH9rMaeKHT+BAsJBT8BoYrnSAoBtC/eMfYgfXP0De8iXip 4avA== 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 o25si123393ejg.728.2020.12.08.20.37.09; Tue, 08 Dec 2020 20:37:41 -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 S1727084AbgLIEfG (ORCPT + 99 others); Tue, 8 Dec 2020 23:35:06 -0500 Received: from outgoing-auth-1.mit.edu ([18.9.28.11]:48626 "EHLO outgoing.mit.edu" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726303AbgLIEfF (ORCPT ); Tue, 8 Dec 2020 23:35:05 -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 0B94YFxV011102 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 8 Dec 2020 23:34:17 -0500 Received: by callcc.thunk.org (Postfix, from userid 15806) id B2BC5420136; Tue, 8 Dec 2020 23:34:15 -0500 (EST) Date: Tue, 8 Dec 2020 23:34:15 -0500 From: "Theodore Y. Ts'o" To: brookxu 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: <20201209043415.GG52960@mit.edu> References: <1604764698-4269-1-git-send-email-brookxu@tencent.com> <1604764698-4269-4-git-send-email-brookxu@tencent.com> <20201203150841.GM441757@mit.edu> <4770d6b2-bb9f-7bc5-4fbd-2104bfeba7c2@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4770d6b2-bb9f-7bc5-4fbd-2104bfeba7c2@gmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Fri, Dec 04, 2020 at 09:26:49AM +0800, brookxu wrote: > > Theodore Y. Ts'o wrote on 2020/12/3 23:08: > > 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. > > Thanks, in the large-market scenario, if we deal with all groups, > the system_zone will be very large, which may reduce performance. > I think the previous method is good, but it needs to be changed > slightly, so that the fault tolerance in the meta_bg scenario > can be improved without the risk of performance degradation. OK, I see. But this is not actually reliable: > >> + if ((i < 5) || ((i % flex_size) == 0)) { This only works if the flex_size is less than or equal to 64 (assuming a 4k blocksize). That's because on 64-bit file systems, we can fit 64 block group descripters in a 4k block group descriptor block, so that's the size of the meta_bg. The default flex_bg size is 16, but it's quite possible to create a file system via "mke2fs -t ext4 -G 256". In that case, the flex_size will be 256, and we would not be including all of the meta_bg groups. So i % flex_size needs to be replaced by "i % meta_bg_size", where meta_bg_size would be initialized to EXT4_DESC_PER_BLOCK(sb). Does that make sense? - Ted