procfs: use faster rb_first_cached()
authorDavidlohr Bueso <[email protected]>
Fri, 8 Sep 2017 23:15:15 +0000 (16:15 -0700)
committerLinus Torvalds <[email protected]>
Sat, 9 Sep 2017 01:26:49 +0000 (18:26 -0700)
commit410bd5ecb276593e7ec1552014083215d4a43c3a
tree3d507f3ba123be043d8a4e7582c8a48a0f71cb07
parentf2686bb48618718c7141f117e2d607594e959bfc
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/[email protected]
Signed-off-by: Davidlohr Bueso <[email protected]>
Acked-by: Peter Zijlstra (Intel) <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
fs/proc/generic.c
fs/proc/internal.h
fs/proc/proc_net.c
fs/proc/root.c