From: Theodore Ts'o <tytso@mit.edu>
To: Andrey Sidorov <qrxd43@motorola.com>
Cc: linux-ext4@vger.kernel.org
Subject: Re: mke2fs with bigalloc is too slow
Date: Wed, 13 Mar 2013 15:00:16 -0400 [thread overview]
Message-ID: <20130313190016.GE5604@thunk.org> (raw)
In-Reply-To: <CAA0+VHz9+LpS9jGbTEE_OE9kvgdXDqj3qMQQV5kTTJ12WDxMPg@mail.gmail.com>
On Wed, Mar 13, 2013 at 08:04:57PM +0400, Andrey Sidorov wrote:
>
> It takes 29 seconds to format 1TB partition as ext4 with 256k cluster
> size on MIPS. e2fsprogs version is 1.42.7.
> The most time consumer is ext2fs_convert_subcluster_bitmap which folds
> 30M into 500K walking through block bitmap bit by bit. Afair, it takes
> less time on x86 since there are asm bit ops for x86, but mips uses
> generic ones.
Actually, these days we use a rbtree to encode the bitmap. That means
that it should be possible to create a very efficient find_first_set
and find_first_zero functions. This would work especially well for
mke2fs since the allocation bitmap will be mostly empty. This I think
would improve things dramatically.
> First thing I did is allocated per-cluster bitmap instead of per-block
> bitmap in ext2fs_initialize so that conversion doesn't occur. That
> dropped mke2fs time from 29s to 2.5s. e2fsck -f found this fresh fs as
> a good one and mounting/writing/reading/unmounting also went good. Of
> course groups are allocated at different offsets and about 60M of
> usable space are lost if compared to 'slow' formatting. That's fine,
> we can live with that.
> Are there any long-term consequences that I've missed? Are there any
> reasons for using block bitmap instead of cluster bitmap except for
> meta-data space efficiency?
Fragmenting the block allocation bitmaps slows down operations that
need to read in multiple block bitmaps in sequence. This includes
dumpe2fs, e2fsck, and in some cases, block allocation. So making this
change is not zero-cost. I agree that 30 seconds for mke2fs is
non-optimal, but I'm surprised you're finding this to be a
showstopper. I assume you're worried about substantially bigger file
systems than just 1TB?
- Ted
next prev parent reply other threads:[~2013-03-13 19:00 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-13 16:04 mke2fs with bigalloc is too slow Andrey Sidorov
2013-03-13 19:00 ` Theodore Ts'o [this message]
2013-03-14 21:53 ` Andrey Sidorov
2013-03-15 14:28 ` Theodore Ts'o
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=20130313190016.GE5604@thunk.org \
--to=tytso@mit.edu \
--cc=linux-ext4@vger.kernel.org \
--cc=qrxd43@motorola.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).