diff options
| author | Dipankar Sarma <dipankar@in.ibm.com> | 2004-10-18 18:14:13 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2004-10-18 18:14:13 -0700 |
| commit | 290ccb59c3d84f771ce560591be8d6158b3fbcb9 (patch) | |
| tree | 14127520aac33e8c9f3973e95cf48e64f33ca456 /include/linux | |
| parent | 61f969b4ed29ebd4882702b9550c242ff68e0c8a (diff) | |
[PATCH] Remove d_bucket
Tested using dcachebench and hevy rename test.
http://lse.sourceforge.net/locking/dcache/rename_test/
While going over dcache code, I realized that d_bucket which was introduced
to prevent hash chain traversals from going into an infinite loop earlier,
is no longer necessary. Originally, when RCU based lock-free lookup was
first introduced, dcache hash chains used list_head. Hash chain traversal
was terminated when dentry->next reaches the list_head in the hash bucket.
However, if renames happen during a lock-free lookup, a dentry may move to
different bucket and subsequent hash chain traversal from there onwards may
not see the list_head in the original bucket at all. In fact, this would
result in the list_head in the bucket interpreted as a list_head in dentry
and bad things will happen after that. Once hlist based hash chains were
introduced in dcache, the termination condition changed and lock-free
traversal would be safe with NULL pointer based termination of hlists.
This means that d_bucket check is no longer required.
There still exist some theoritical livelocks like a dentry getting
continuously moving and lock-free look-up never terminating. But that
isn't really any worse that what we have. In return for these changes, we
reduce the dentry size by the size of a pointer. That should make akpm and
mpm happy.
Signed-off-by: Dipankar Sarma <dipankar@in.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/dcache.h | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/include/linux/dcache.h b/include/linux/dcache.h index b378e57b2743..f4bc1ac23daa 100644 --- a/include/linux/dcache.h +++ b/include/linux/dcache.h @@ -28,7 +28,7 @@ struct vfsmount; * "quick string" -- eases parameter passing, but more importantly * saves "metadata" about the string (ie length and the hash). * - * hash comes first so it snuggles against d_parent and d_bucket in the + * hash comes first so it snuggles against d_parent in the * dentry. */ struct qstr { @@ -91,7 +91,6 @@ struct dentry { * so they all fit in a 16-byte range, with 16-byte alignment. */ struct dentry *d_parent; /* parent directory */ - struct hlist_head *d_bucket; /* lookup hash bucket */ struct qstr d_name; struct list_head d_lru; /* LRU list */ |
