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>
This commit is contained in:
committed by
Linus Torvalds
parent
f2686bb486
commit
410bd5ecb2
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user