public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Theodore Tso <tytso@mit.edu>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Abhishek Rai <abhishekrai@google.com>,
	Andreas Dilger <adilger@sun.com>,
	linux-kernel@vger.kernel.org, Ken Chen <kenchen@google.com>,
	Mike Waychison <mikew@google.com>
Subject: Re: [PATCH] Clustering indirect blocks in Ext3
Date: Fri, 16 Nov 2007 16:11:33 -0500	[thread overview]
Message-ID: <20071116211133.GJ11339@thunk.org> (raw)
In-Reply-To: <20071115230219.1fe9338c.akpm@linux-foundation.org>

On Thu, Nov 15, 2007 at 11:02:19PM -0800, Andrew Morton wrote:
> 
> Presmably it starts around 50% of the way into the blockgroup?

Yes.

> How do you decide its size?

It's fixed at 1/128th (0.78%) of the blockgroup.

> What happens when it fills up but we still have room for more data blocks
> in that blockgroup?

It does fall back, but it does so starting from the beginning of the
block group by using the old-style allocation routines if it can't
find any space in the metacluster region.  What I'd suggest that it do
instead is to start searching from the end of metacluster region, and
then wrap around to the beginning of the block group, and then if it
can't find any blocks when it reaches the beginning of the metacluster
region, then go to the next block group that would be used by
ext3_new_blocks(), and start searching in the metacluster region ---
that way a smart e2fsck that is doing clustering could just arrange to
pre-read the metacluster region for each block group, and if it finds
an indirect block that is another block group's metacluster region, it
could try reading in those blocks too.

In order to do this, I'd suggest considering to fold ext3_new_blocks
and ext3_new_indirect_blocks() into the same function, with just a
passed-in flag to indicate whether for each block group the
metacluster region or the non-metacluster region should be searched
first.  This would also make elimiate some duplicated code.

> Can this reserved area cause disk space wastage (all data blocks used,
> metacluster area not yet full).

No, not as far as I can see.

> Less speedup, for more-and-smaller files, it appears.
> 
> An important question is: how does it stand up over time?  Simply laying
> files out a single time on a fresh fs is the easy case.  But what happens
> if that disk has been in continuous create/delete/truncate/append usage for
> six months?

Another question is how does it stand up if the average size of files
is different from what you anticipate?  If the files are bigger than
you expect, or smaller than you expect, then the ratio of indirect
blocks to data blocks will be different, at which point allocations
won't be perfectly split up between metacluster region.

For this reason, the exact size of the metacluster region should
probably be a superblock tunable --- and once we have the superblock
tunable, I'd use the non-zero metacluster size to determine whether or
not to enable this feature, and not to use a mount option.  Mount
options really should be avoided whenever possible, in favor of
settings in the superblock.

						- Ted

  parent reply	other threads:[~2007-11-16 21:12 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-16  5:02 [PATCH] Clustering indirect blocks in Ext3 Abhishek Rai
2007-11-16  7:02 ` Andrew Morton
2007-11-16  7:37   ` Matt Mackall
2007-11-18 15:52     ` Abhishek Rai
2007-11-18 20:47       ` Matt Mackall
2007-11-19 10:34         ` Kyungmin Park
2007-11-20 20:25       ` John Stoffel
2007-11-16 11:28   ` Andreas Dilger
2007-11-16 21:11   ` Theodore Tso [this message]
2007-11-17  0:25     ` Abhishek Rai
2007-11-17  2:58       ` Theodore Tso
2007-11-17  8:58         ` Abhishek Rai
2007-12-21 14:15         ` Abhishek Rai
2008-01-10 21:17           ` Abhishek Rai
2008-01-11 17:05             ` Daniel Phillips
2008-01-12  0:04               ` Andrew Morton
2008-01-12  6:05                 ` Daniel Phillips
2008-01-13  5:06                   ` Abhishek Rai
2007-11-16 22:27   ` Abhishek Rai
     [not found] <9q1CT-82L-3@gated-at.bofh.it>
     [not found] ` <9q3v2-2Br-3@gated-at.bofh.it>
     [not found]   ` <9qgLE-7ds-21@gated-at.bofh.it>
     [not found]     ` <9qjJx-3wE-9@gated-at.bofh.it>
     [not found]       ` <9qm4D-70Q-1@gated-at.bofh.it>
     [not found]         ` <9CQTt-7cr-27@gated-at.bofh.it>
     [not found]           ` <9KcYS-46E-27@gated-at.bofh.it>
2008-01-11 14:12             ` Bodo Eggert
2008-01-11 14:49               ` Abhishek Rai

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=20071116211133.GJ11339@thunk.org \
    --to=tytso@mit.edu \
    --cc=abhishekrai@google.com \
    --cc=adilger@sun.com \
    --cc=akpm@linux-foundation.org \
    --cc=kenchen@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mikew@google.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