From: Andreas Dilger <adilger@sun.com>
To: Curt Wohlgemuth <curtw@google.com>
Cc: ext4 development <linux-ext4@vger.kernel.org>
Subject: Re: Question on block group allocation
Date: Mon, 27 Apr 2009 17:12:40 -0600 [thread overview]
Message-ID: <20090427231240.GA8821@webber.adilger.int> (raw)
In-Reply-To: <20090423190817.GN3209@webber.adilger.int>
On Apr 23, 2009 13:08 -0600, Andreas Dilger wrote:
> This is likely the "uninit_bg" feature that is causing the allocations
> to skip groups which are marked BLOCK_UNINIT. In some sense the benefit
> of skipping the block bitmap read during e2fsck is probably not at all
> beneficial compared to the cost of the extra seeking during IO. As the
> filesystem gets more full, the BLOCK_UNIIT flags would be cleared anyways,
> so we might as well just keep the early allocations contiguous.
>
> A simple change to verify this would be something like the following,
> but it hasn't actually been tested.
>
> --- ./fs/ext4/mballoc.c.uninit 2009-04-08 19:13:13.000000000 -0600
> +++ ./fs/ext4/mballoc.c 2009-04-23 13:02:22.000000000 -0600
> @@ -1742,10 +1723,6 @@ static int ext4_mb_good_group(struct ext
> switch (cr) {
> case 0:
> BUG_ON(ac->ac_2order == 0);
> - /* If this group is uninitialized, skip it initially */
> - desc = ext4_get_group_desc(ac->ac_sb, group, NULL);
> - if (desc->bg_flags & cpu_to_le16(EXT4_BG_BLOCK_UNINIT))
> - return 0;
>
> bits = ac->ac_sb->s_blocksize_bits + 1;
> for (i = ac->ac_2order; i <= bits; i++)
> @@ -2039,9 +2035,7 @@ repeat:
> ac->ac_groups_scanned++;
> desc = ext4_get_group_desc(sb, group, NULL);
> - if (cr == 0 || (desc->bg_flags &
> - cpu_to_le16(EXT4_BG_BLOCK_UNINIT) &&
> - ac->ac_2order != 0))
> + if (cr == 0)
> ext4_mb_simple_scan_group(ac, &e4b);
> else if (cr == 1 &&
> ac->ac_g_ex.fe_len == sbi->s_stripe)
Because this is actually proving to be useful:
Signed-off-by: Andreas Dilger <adilger@sun.com>
As we discussed in the call, I suspect BLOCK_UNINIT was more useful in the
past when directories were spread over all groups evenly (pre-Orlov), and
before flex_bg where seeking to read all of the bitmaps was a slow and
painful process. For flex_bg it could be WORSE to skip bitmap reads because
instead of doing contiguous 64kB reads it may now doing read 4kB, seek,
read 4kB, seek, etc.
Cheers, Andreas
--
Andreas Dilger
Sr. Staff Engineer, Lustre Group
Sun Microsystems of Canada, Inc.
prev parent reply other threads:[~2009-04-27 23:13 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-04-23 16:41 Question on block group allocation Curt Wohlgemuth
2009-04-23 19:08 ` Andreas Dilger
2009-04-23 22:02 ` Curt Wohlgemuth
2009-04-27 2:14 ` Theodore Tso
2009-04-27 5:29 ` Curt Wohlgemuth
2009-04-27 10:42 ` Theodore Tso
2009-04-27 22:40 ` Theodore Tso
2009-04-29 18:38 ` Curt Wohlgemuth
2009-04-29 19:37 ` Theodore Tso
2009-04-29 20:21 ` Curt Wohlgemuth
2009-04-29 21:20 ` Theodore Tso
2009-04-29 21:50 ` Theodore Tso
2009-04-29 22:29 ` Curt Wohlgemuth
2009-05-01 4:39 ` Theodore Tso
2009-05-04 15:52 ` Curt Wohlgemuth
2009-04-29 19:16 ` Theodore Tso
2009-04-27 23:12 ` Andreas Dilger [this message]
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=20090427231240.GA8821@webber.adilger.int \
--to=adilger@sun.com \
--cc=curtw@google.com \
--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 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).