[lkml]   [2001]   [Nov]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: File System Performance
Mike Fedyk writes:
> On Mon, Nov 12, 2001 at 12:59:54PM -0700, Richard Gooch wrote:
> > Here's an idea: add a "--compact" option to tar, so that it creates
> > *all* inodes (files and directories alike) in the base directory, and
> > then renames newly created entries to shuffle them into their correct
> > positions. That should limit the number of block groups that are used,
> > right?
> >
> > It would probably also be a good idea to do that for cp as well, so
> > that when I do a "cp -al" of a virgin kernel tree, I can keep all the
> > directory inodes together. It will make a cold diff even faster.
> I don't think that would help at all... With the current file/dir
> allocator it will choose a new block group for each directory no
> matter what the parent is...

I thought the current implementation was that when creating a
directory, ext2fs searches forward from the block group the parent
directory is in, looking for a "relatively free" block group. So, a
number of successive calls to mkdir(2) with the same parent directory
will result in the child directories being in the same block group.

So, creating the directory tree by creating directories in the base
directory and then shuffling should result in the directories be
spread out over a modest number of block groups, rather than a large

Addendum to my scheme: leaf nodes should be created in their
directories, not in the base directory. IOW, it's only directories
that should use this trick.

Am I wrong in my understanding of the current algorithm?


To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 13:13    [W:0.114 / U:0.332 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site