linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Theodore Ts'o <tytso@mit.edu>
To: Kevin Liao <kevinlia@gmail.com>
Cc: Yongqiang Yang <xiaoqiangnk@gmail.com>,
	Anssi Hannula <anssi.hannula@iki.fi>,
	Ext4 Developers List <linux-ext4@vger.kernel.org>
Subject: Re: [PATCH 2/2] resize2fs: fix overhead calculation for meta_bg file systems
Date: Thu, 13 Sep 2012 19:21:58 -0400	[thread overview]
Message-ID: <20120913232157.GA14184@thunk.org> (raw)
In-Reply-To: <CAF_MivFMtFvTN9Gwdjk+imenuUHOcO3vbeha6nt+eqovRK3VXw@mail.gmail.com>

On Wed, Sep 05, 2012 at 02:32:32PM +0800, Kevin Liao wrote:
> 
> I had done some simple and quick test. The following is the result.
> 
> For 20TB with 64bit,meta_bg,^resize_inode
> mke2fs: 1m25.090s
> mount: 19.992s
> e2fsck: 2m55.048s
> 
> For 20TB without 64bit,meta_bg,^resize_inode
> mke2fs: 1m3.660s
> mount: 1.458s
> e2fsck: 1m56.055s

The reason for this is how meta_bg changes how the block group
descriptors are laid out.  Originally, the block group descriptors
were located contiguously.  From a 12T filesystem without meta_bg,
you'll see this from dumpe2fs:

Group 0: (Blocks 0-32767)
  Primary superblock at 0, Group descriptors at 1-768

If the file system is created with meta_bg, then group descriptors
that have to be read when the file system is opened by libext2fs or
when the file system is mounted look like this:

Group 0: (Blocks 0-32767)
  Primary superblock at 0, Group descriptor at 1
Group 128: (Blocks 4194304-4227071) [INODE_UNINIT]
  Group descriptor at 4194304
Group 256: (Blocks 8388608-8421375) [INODE_UNINIT]
  Group descriptor at 8388608
Group 384: (Blocks 12582912-12615679) [INODE_UNINIT]
  Group descriptor at 12582912
  ...

In the set of kernel and e2fsprogs patches that I just released, we
can partially work around this problem by starting with the
resize_inode, and only switch over to the meta_bg once we have
exhausted the resize_inode scheme.  So now we can do this:

    mke2fs -t ext4 -q -O 64bit /dev/vdc 12T
    mount /dev/vdc
    resize2fs /dev/vdc 18T

After the resize2fs, the block group descriptors for the first 16TB
will be contiguous:

Group 0: (Blocks 0-32767) [ITABLE_ZEROED]
  Primary superblock at 0, Group descriptors at 1-2048

after that, there will be singleton block group descriptor blocks, i.e.:

Group 131136: (Blocks 4297064448-4297097215) [INODE_UNINIT]
  Group descriptor at 4297064448

The other thing we can do to speed up the mount times is change how
the kernel to lazily read the block group descriptors, instead of
trying to read them all at mount time, at least once they are no
longer contiguous.  I'll look into seeing what we can do to improve
things on that front.

Regards,

					- Ted

  parent reply	other threads:[~2012-09-13 23:22 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-02  9:52 [PATCH] resize2fs: support online-resizing for meta_bg and 64bits features Yongqiang Yang
2012-09-02 10:31 ` Yongqiang Yang
2012-09-03  0:50   ` Theodore Ts'o
2012-09-03 16:45   ` Theodore Ts'o
2012-09-03 16:45     ` [PATCH 1/2] resize2fs: allow meta_bg/64-bit file systems to be online resized Theodore Ts'o
2012-09-03 16:45       ` [PATCH 2/2] resize2fs: fix overhead calculation for meta_bg file systems Theodore Ts'o
2012-09-04  1:59         ` Yongqiang Yang
2012-09-04  2:14           ` Kevin Liao
2012-09-04  2:14           ` Theodore Ts'o
2012-09-04 17:05             ` Anssi Hannula
2012-09-05  2:10               ` Yongqiang Yang
2012-09-05  4:55                 ` Theodore Ts'o
2012-09-05  5:16                   ` Yongqiang Yang
2012-09-05  5:38                     ` Theodore Ts'o
2012-09-06 14:22                 ` Anssi Hannula
2012-09-06 16:19                   ` Yongqiang Yang
2012-09-05  6:32             ` Kevin Liao
2012-09-05  6:44               ` Yongqiang Yang
2012-09-05  6:50                 ` Kevin Liao
2012-09-13 23:21               ` Theodore Ts'o [this message]
2012-09-14  3:24                 ` Kevin Liao
2012-09-04  2:02         ` Yongqiang Yang
2012-09-03 21:02     ` [PATCH] resize2fs: support online-resizing for meta_bg and 64bits features Kai Grosshaus
2012-09-03 23:00       ` Theodore Ts'o
2012-09-03 23:33         ` Kai Großhaus
2012-09-04  2:01     ` Yongqiang Yang

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=20120913232157.GA14184@thunk.org \
    --to=tytso@mit.edu \
    --cc=anssi.hannula@iki.fi \
    --cc=kevinlia@gmail.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=xiaoqiangnk@gmail.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).