diff options
author | Davidlohr Bueso <dave@stgolabs.net> | 2017-09-09 01:15:15 +0200 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2017-09-09 03:26:49 +0200 |
commit | 410bd5ecb276593e7ec1552014083215d4a43c3a (patch) | |
tree | 3d507f3ba123be043d8a4e7582c8a48a0f71cb07 /fs/proc/proc_net.c | |
parent | lib/interval-tree: correct comment wrt generic flavor (diff) | |
download | linux-410bd5ecb276593e7ec1552014083215d4a43c3a.tar.xz linux-410bd5ecb276593e7ec1552014083215d4a43c3a.zip |
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: http://lkml.kernel.org/r/20170719014603.19029-14-dave@stgolabs.net
Signed-off-by: Davidlohr Bueso <dbueso@suse.de>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/proc/proc_net.c')
-rw-r--r-- | fs/proc/proc_net.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/proc/proc_net.c b/fs/proc/proc_net.c index d72fc40241d9..a2bf369c923d 100644 --- a/fs/proc/proc_net.c +++ b/fs/proc/proc_net.c @@ -196,7 +196,7 @@ static __net_init int proc_net_ns_init(struct net *net) if (!netd) goto out; - netd->subdir = RB_ROOT; + netd->subdir = RB_ROOT_CACHED; netd->data = net; netd->nlink = 2; netd->namelen = 3; |