All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Theodore Ts'o" <tytso@mit.edu>
To: Ext4 Developers List <linux-ext4@vger.kernel.org>
Subject: Re: [PATCH 3/3] resize2fs: optimize resize2fs_calculate_summary_stats()
Date: Tue, 14 Sep 2021 16:09:02 -0400	[thread overview]
Message-ID: <YUEBXuE56KCPWOoy@mit.edu> (raw)
In-Reply-To: <20210914191104.2283033-3-tytso@mit.edu>

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 <tytso@mit.edu>
> ---
>  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

  reply	other threads:[~2021-09-14 20:09 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-14 19:11 [PATCH 1/3] resize2fs: attempt to keep the # of inodes valid by removing the last bg Theodore Ts'o
2021-09-14 19:11 ` [PATCH 2/3] resize2fs: adjust new size of the file system to allow a successful resize Theodore Ts'o
2021-09-16 17:59   ` Leah Rumancik
2021-09-14 19:11 ` [PATCH 3/3] resize2fs: optimize resize2fs_calculate_summary_stats() Theodore Ts'o
2021-09-14 20:09   ` Theodore Ts'o [this message]
2021-09-16 17:57 ` [PATCH 1/3] resize2fs: attempt to keep the # of inodes valid by removing the last bg Leah Rumancik

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YUEBXuE56KCPWOoy@mit.edu \
    --to=tytso@mit.edu \
    --cc=linux-ext4@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.