Re: Enabling h-trees too early?

2007-09-21 Thread Andi Kleen
Theodore Tso [EMAIL PROTECTED] writes: Certainly one of the things that we could consider is for small directories to do an in-memory sort of all of the directory entries at opendir() time, and keeping that list until it is closed. We can't do this for really big directories, but we could

Re: Enabling h-trees too early?

2007-09-21 Thread Theodore Tso
On Fri, Sep 21, 2007 at 11:02:58AM +0200, Andi Kleen wrote: I assume you mean sort by inode, because sort by htree key would be as bad as htrees. But wouldn't that break parallel readdir for a directory that just grows from 32/64K to over it? e.g. if the sort moves already read entries to

Re: Enabling h-trees too early?

2007-09-20 Thread Theodore Tso
On Thu, Sep 20, 2007 at 03:33:50PM +0200, Jan Kara wrote: So for example deleting kernel tree on my computer takes ~14 seconds with h-trees and less than 9 without them. Also doing 'cp -lr' of the kernel tree takes 8 seconds with h-trees and 6.3s without them... So I think the performance

Re: Enabling h-trees too early?

2007-09-20 Thread Jan Kara
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

Re: Enabling h-trees too early?

2007-09-20 Thread Theodore Tso
On Thu, Sep 20, 2007 at 06:19:04PM +0200, Jan Kara wrote: 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);

Enabling h-trees too early?

2007-09-19 Thread Jan Kara
Hi, I was just wondering: Currently we start to build h-tree in a directory already when the size of directory exceeds one block. But honestly, it does not seem to make much sence to use this feature until the directory is much larger (I'd say at least 16 or 32 KB). It actually slows down

Re: Enabling h-trees too early?

2007-09-19 Thread Andreas Dilger
On Sep 19, 2007 17:07 +0200, Jan Kara wrote: I was just wondering: Currently we start to build h-tree in a directory already when the size of directory exceeds one block. But honestly, it does not seem to make much sence to use this feature until the directory is much larger (I'd say at

Re: Enabling h-trees too early?

2007-09-19 Thread Theodore Tso
On Wed, Sep 19, 2007 at 05:07:15PM +0200, Jan Kara wrote: I was just wondering: Currently we start to build h-tree in a directory already when the size of directory exceeds one block. But honestly, it does not seem to make much sence to use this feature until the directory is much larger