path: root/fs/proc/internal.h
diff options
authorDavidlohr Bueso <>2017-09-08 16:15:15 -0700
committerLinus Torvalds <>2017-09-08 18:26:49 -0700
commit410bd5ecb276593e7ec1552014083215d4a43c3a (patch)
tree3d507f3ba123be043d8a4e7582c8a48a0f71cb07 /fs/proc/internal.h
parentf2686bb48618718c7141f117e2d607594e959bfc (diff)
procfs: use faster rb_first_cached()
... such that we can avoid the tree walks to get the node with the smallest key. Semantically the same, as the previously used rb_first(), but O(1). The main overhead is the extra footprint for the cached rb_node pointer, which should not matter for procfs. Link: Signed-off-by: Davidlohr Bueso <> Acked-by: Peter Zijlstra (Intel) <> Signed-off-by: Andrew Morton <> Signed-off-by: Linus Torvalds <>
Diffstat (limited to 'fs/proc/internal.h')
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/proc/internal.h b/fs/proc/internal.h
index 2cbfcd32e884..a34195e92b20 100644
--- a/fs/proc/internal.h
+++ b/fs/proc/internal.h
@@ -40,7 +40,7 @@ struct proc_dir_entry {
const struct inode_operations *proc_iops;
const struct file_operations *proc_fops;
struct proc_dir_entry *parent;
- struct rb_root subdir;
+ struct rb_root_cached subdir;
struct rb_node subdir_node;
void *data;
atomic_t count; /* use count */