lkml.org 
[lkml]   [2012]   [Mar]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: getdents - ext4 vs btrfs performance
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.



\
 
 \ /
  Last update: 2012-03-13 20:09    [W:0.090 / U:3.364 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site