linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: Theodore Tso <tytso@mit.edu>
Cc: linux-ext4@vger.kernel.org
Subject: Re: Enabling h-trees too early?
Date: Thu, 20 Sep 2007 18:19:04 +0200	[thread overview]
Message-ID: <20070920161903.GJ2689@duck.suse.cz> (raw)
In-Reply-To: <20070920151440.GE30221@thunk.org>

On Thu 20-09-07 11:14:40, Theodore Tso wrote:
> On Thu, Sep 20, 2007 at 04:58:39PM +0200, Jan Kara wrote:
> >   Hmm, strange - I've just looked at my computer and dir_index is set
> > just for 5 directories in my tree.
> 
> I looked at a tree that had object files, which is probably why I had
> 8 directories; I'm guessing you probably just had kernel sources and
> no build files.
> 
> > If I try deleting just them, I also
> > see some performance decrease but it's less than if I try deleting the
> > whole tree (and that result seems to be quite consistent)... There's something
> > fishy there. Maybe I could try seekwatcher or something similar to see
> > what's really happening.
> 
> That is very strange.....
  Just a guess: Can't the culprit be the following test in ext3/4_readdir()?
if (EXT4_HAS_COMPAT_FEATURE(inode->i_sb, EXT4_FEATURE_COMPAT_DIR_INDEX) &&
    ((EXT4_I(inode)->i_flags & EXT4_INDEX_FL) ||
     ((inode->i_size >> sb->s_blocksize_bits) == 1))) {
        error = ext4_dx_readdir(filp, dirent, filldir);
        if (error != ERR_BAD_DX_DIR) {
                ret = error;
                goto out;
        }
        /*
         * We don't set the inode dirty flag since it's not
         * critical that it get flushed back to the disk.
         */
        EXT4_I(filp->f_path.dentry->d_inode)->i_flags &= ~EXT4_INDEX_FL;
}
  It calls ext4_dx_readdir() for *every* directory with 1 block (we have
1326 of them in the kernel tree). Now ext4_dx_readdir() calls
ext4_htree_fill_tree() which finds out the directory is not h-tree and
and calls htree_dirblock_to_tree(). So even for 4KB directories we end up
deleting inodes in hash order! And as a bonus we burn some cycles building
trees etc. What is the point of this?

									Honza
-- 
Jan Kara <jack@suse.cz>
SUSE Labs, CR

  reply	other threads:[~2007-09-20 15:58 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-19 15:07 Enabling h-trees too early? Jan Kara
2007-09-19 17:02 ` Andreas Dilger
2007-09-19 18:24 ` Theodore Tso
2007-09-20 13:33   ` Jan Kara
2007-09-20 14:28     ` Theodore Tso
2007-09-20 14:58       ` Jan Kara
2007-09-20 15:14         ` Theodore Tso
2007-09-20 16:19           ` Jan Kara [this message]
2007-09-20 17:02             ` Theodore Tso
2007-09-21 13:49               ` Jan Kara
2007-09-21  9:02   ` Andi Kleen
2007-09-21 11:45     ` Theodore Tso

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=20070920161903.GJ2689@duck.suse.cz \
    --to=jack@suse.cz \
    --cc=linux-ext4@vger.kernel.org \
    --cc=tytso@mit.edu \
    /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).