diff options
author | Alexey Dobriyan <adobriyan@gmail.com> | 2018-04-10 19:32:20 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2018-04-11 13:28:34 -0400 |
commit | 4f1134370a29a5f2d0f4b4be4c5e2fddd38f0f9d (patch) | |
tree | 0fcae1f568cf1c2870f615e214f3e92a77afcd30 /fs/proc/internal.h | |
parent | 05c3f29283af9e3da0ab7414f666cb37f530950a (diff) |
proc: use slower rb_first()
In a typical for /proc "open+read+close" usecase, dentry is looked up
successfully on open only to be killed in dput() on close. In fact
dentries which aren't /proc/*/... and /proc/sys/* were almost NEVER
CACHED. Simple printk in proc_lookup_de() shows that.
Now that ->delete hook intelligently picks which dentries should live in
dcache and which should not, rbtree caching is not necessary as dcache
does it job, at last!
As a side effect, struct proc_dir_entry shrinks by one pointer which can
go into inline name.
Link: http://lkml.kernel.org/r/20180314231032.GA15854@avx2
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Acked-by: Davidlohr Bueso <dbueso@suse.de>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/proc/internal.h')
-rw-r--r-- | fs/proc/internal.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/proc/internal.h b/fs/proc/internal.h index b7024f174778..0f1692e63cb6 100644 --- a/fs/proc/internal.h +++ b/fs/proc/internal.h | |||
@@ -51,15 +51,15 @@ struct proc_dir_entry { | |||
51 | kgid_t gid; | 51 | kgid_t gid; |
52 | loff_t size; | 52 | loff_t size; |
53 | struct proc_dir_entry *parent; | 53 | struct proc_dir_entry *parent; |
54 | struct rb_root_cached subdir; | 54 | struct rb_root subdir; |
55 | struct rb_node subdir_node; | 55 | struct rb_node subdir_node; |
56 | char *name; | 56 | char *name; |
57 | umode_t mode; | 57 | umode_t mode; |
58 | u8 namelen; | 58 | u8 namelen; |
59 | #ifdef CONFIG_64BIT | 59 | #ifdef CONFIG_64BIT |
60 | #define SIZEOF_PDE_INLINE_NAME (192-147) | 60 | #define SIZEOF_PDE_INLINE_NAME (192-139) |
61 | #else | 61 | #else |
62 | #define SIZEOF_PDE_INLINE_NAME (128-91) | 62 | #define SIZEOF_PDE_INLINE_NAME (128-87) |
63 | #endif | 63 | #endif |
64 | char inline_name[SIZEOF_PDE_INLINE_NAME]; | 64 | char inline_name[SIZEOF_PDE_INLINE_NAME]; |
65 | } __randomize_layout; | 65 | } __randomize_layout; |