Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp980313pxb; Tue, 14 Sep 2021 13:09:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyeQjsqjBqb4JDyixYhq1ZtH+alYilG8ws5kLQ+0BtftbnbDRlsy5C9D7GPR91Q6Pvuzl5b X-Received: by 2002:a05:6e02:20e7:: with SMTP id q7mr14090893ilv.212.1631650172661; Tue, 14 Sep 2021 13:09:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631650172; cv=none; d=google.com; s=arc-20160816; b=NLFaK57W3uZoDs5/k9vcjOoeFIw02PAhJ/FEbm8icFyjQUpS1VHxN9tsCQkVStZBLl KduZic9cAYhasBrYFjAg8TgW/m3zKMV4+avTZaZwt0GJ058Am7aPswkROwTcPwspIZMt SU9vyhRIlsi8FGwkJdjSTdnIu2gHKBPbDA1gAGFdwCU9Bx6CyWLpgcS0YX7cGP67rNa9 XpxHsDyUz+UzipLOga3y+mApmTDchbylUA/M3CGkTGNfbsDZIsQGDNHVqzJe9MMH2CQj RLyFxypRKN7fuOXvMgwT5ffwD6o2+SkZOJwWkByUxa+huLZhyIERxek6X7YIAQn18CvV NXaA== 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:to:from:date; bh=whLqvx11cGrwBSLOlq3VkjzcllRhZkWNPqk8AhQMkSc=; b=MSzGXpJyGsoNyi5Yx6b/V641+asZvPtiZ6/ylcs1FSsyC1D22rzXDx8P5S0APAdWDO ZEtyOW6+ywUwLHw4OJYOGl/pHHpzd5/wIkc5kzNGBEjfS6XQJqdcr7FCxNGpF/rDDKKe LGADmx1sOMNnnYANNlB+vyDfSg+eWKNcG8Bbg9cAfajHdevazHCObicttUBqa59V4d5d R8uW3mCwUoMQFKyUt/3Wwnr6zjJJHe/v9+KGFNKUE4A2TasVlOTbp0K4S6XHSudeKFD/ EVm/6/9ef2fMVsJTs1rRx0s8ru5XadtKr2hhha+Q0a+ZFpb0hugpeuFwMLODzYgTXbf7 VTKw== 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 n20si11113327iod.5.2021.09.14.13.09.09; Tue, 14 Sep 2021 13:09:32 -0700 (PDT) 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 S233280AbhINUKX (ORCPT + 99 others); Tue, 14 Sep 2021 16:10:23 -0400 Received: from outgoing-auth-1.mit.edu ([18.9.28.11]:33563 "EHLO outgoing.mit.edu" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S232545AbhINUKW (ORCPT ); Tue, 14 Sep 2021 16:10:22 -0400 Received: from cwcc.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 18EK92pX015580 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 14 Sep 2021 16:09:02 -0400 Received: by cwcc.thunk.org (Postfix, from userid 15806) id 1460E15C3424; Tue, 14 Sep 2021 16:09:02 -0400 (EDT) Date: Tue, 14 Sep 2021 16:09:02 -0400 From: "Theodore Ts'o" To: Ext4 Developers List Subject: Re: [PATCH 3/3] resize2fs: optimize resize2fs_calculate_summary_stats() Message-ID: References: <20210914191104.2283033-1-tytso@mit.edu> <20210914191104.2283033-3-tytso@mit.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210914191104.2283033-3-tytso@mit.edu> Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Tue, Sep 14, 2021 at 03:11:04PM -0400, Theodore Ts'o wrote: > Speed up an off-line resize of a 10GB file system to 64TB located on > tmpfs from 90 seconds to 16 seconds by extracting block group bitmaps > using a population count function to count the blocks in use instead > checking each bit in the block bitmap. > > Signed-off-by: Theodore Ts'o > --- > resize/resize2fs.c | 74 ++++++++++++++-------------------------------- > 1 file changed, 23 insertions(+), 51 deletions(-) > > diff --git a/resize/resize2fs.c b/resize/resize2fs.c > + retval = ext2fs_get_block_bitmap_range2(fs->block_map, > + C2B(blk), fs->super->s_clusters_per_group, bitmap_buf); Whoops, this should be B2C to convert a block number to a cluster number. Hmm, I note that this wasn't picked up by our regression tests. Mental note to self --- we need to add more regression tests to better exercise bigalloc resizes. Currently we have a big warning which gets printed about off-line resizes of bigalloc file systems being experimentlal, but we should aim to do better. :-) - Ted