Re: getdents - ext4 vs btrfs performance
From: Phillip Susi
Date: Tue Mar 13 2012 - 15:06:13 EST
On 3/9/2012 11:48 PM, Ted Ts'o wrote:
I suspect the best optimization for now is probably something like
this:
1) Since the vast majority of directories are less than (say) 256k
(this would be a tunable value), for directories which are less than
this threshold size, the entire directory is sucked in after the first
readdir() after an opendir() or rewinddir(). The directory contents
are then sorted by inode number (or loaded into an rbtree ordered by
inode number), and returned back to userspace in the inode order via
readdir(). The directory contents will be released on a closedir() or
rewinddir().
Why not just separate the hash table from the conventional, mostly in
inode order directory entries? For instance, the first 200k of the
directory could be the normal entries that would tend to be in inode
order ( and e2fsck -D would reorder ), and the last 56k of the directory
would contain the hash table. Then readdir() just walks the directory
like normal, and namei() can check the hash table.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/