alistair23-linux/fs/proc
Nicolas Dichtel 710585d492 fs/proc: use a rb tree for the directory entries
When a lot of netdevices are created, one of the bottleneck is the
creation of proc entries.  This serie aims to accelerate this part.

The current implementation for the directories in /proc is using a single
linked list.  This is slow when handling directories with large numbers of
entries (eg netdevice-related entries when lots of tunnels are opened).

This patch replaces this linked list by a red-black tree.

Here are some numbers:

dummy30000.batch contains 30 000 times 'link add type dummy'.

Before the patch:
  $ time ip -b dummy30000.batch
  real    2m31.950s
  user    0m0.440s
  sys     2m21.440s
  $ time rmmod dummy
  real    1m35.764s
  user    0m0.000s
  sys     1m24.088s

After the patch:
  $ time ip -b dummy30000.batch
  real    2m0.874s
  user    0m0.448s
  sys     1m49.720s
  $ time rmmod dummy
  real    1m13.988s
  user    0m0.000s
  sys     1m1.008s

The idea of improving this part was suggested by Thierry Herbelot.

[akpm@linux-foundation.org: initialise proc_root.subdir at compile time]
Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Acked-by: David S. Miller <davem@davemloft.net>
Cc: Thierry Herbelot <thierry.herbelot@6wind.com>.
Acked-by: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2014-12-10 17:41:09 -08:00
..
array.c Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security 2014-08-06 08:06:39 -07:00
base.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2014-10-13 11:28:42 +02:00
cmdline.c
consoles.c
cpuinfo.c
devices.c
fd.c vfs: Remove d_drop calls from d_revalidate implementations 2014-10-09 02:38:58 -04:00
fd.h
generic.c fs/proc: use a rb tree for the directory entries 2014-12-10 17:41:09 -08:00
inode.c proc: Implement /proc/thread-self to point at the directory of the current thread 2014-08-04 10:07:11 -07:00
internal.h fs/proc: use a rb tree for the directory entries 2014-12-10 17:41:09 -08:00
interrupts.c
Kconfig
kcore.c fs/proc/kcore.c: don't add modules range to kcore if it's equal to vmcore range 2014-10-09 22:25:50 -04:00
kmsg.c
loadavg.c
Makefile proc: Implement /proc/thread-self to point at the directory of the current thread 2014-08-04 10:07:11 -07:00
meminfo.c mm: export NR_SHMEM via sysinfo(2) / si_meminfo() interfaces 2014-08-06 18:01:19 -07:00
namespaces.c
nommu.c
page.c mm/balloon_compaction: add vmstat counters and kpageflags bit 2014-10-09 22:26:01 -04:00
proc_net.c fs/proc: use a rb tree for the directory entries 2014-12-10 17:41:09 -08:00
proc_sysctl.c sysctl: remove typedef ctl_table 2014-08-08 15:57:24 -07:00
proc_tty.c proc: remove proc_tty_ldisc variable 2014-08-08 15:57:22 -07:00
root.c fs/proc: use a rb tree for the directory entries 2014-12-10 17:41:09 -08:00
self.c
softirqs.c
stat.c
task_mmu.c mm: fix huge zero page accounting in smaps report 2014-12-10 17:41:08 -08:00
task_nommu.c proc/maps: make vm_is_stack() logic namespace-friendly 2014-10-09 22:25:50 -04:00
thread_self.c proc: Implement /proc/thread-self to point at the directory of the current thread 2014-08-04 10:07:11 -07:00
uptime.c
version.c
vmcore.c fs/proc/vmcore.c:mmap_vmcore: skip non-ram pages reported by hypervisors 2014-08-08 15:57:23 -07:00