Ingo Molnar 1b5180b651 [PATCH] notifiers: fix blocking_notifier_call_chain() scalability
while lock-profiling the -rt kernel i noticed weird contention during
mmap-intense workloads, and the tracer showed the following gem, in one
of our MM hotpaths:

 threaded-2771  1....   65us : sys_munmap (sysenter_do_call)
 threaded-2771  1....   66us : profile_munmap (sys_munmap)
 threaded-2771  1....   66us : blocking_notifier_call_chain (profile_munmap)
 threaded-2771  1....   66us : rt_down_read (blocking_notifier_call_chain)

ouch! a global rw-semaphore taken in one of the most performance-
sensitive codepaths of the kernel.  And i dont even have oprofile
enabled! All distro kernels have CONFIG_PROFILING enabled, so this
scalability problem affects the majority of Linux users.

The fix is to enhance blocking_notifier_call_chain() to only take the
lock if there appears to be work on the call-chain.

With this patch applied i get nicely saturated system, and much higher
munmap performance, on SMP systems.

And as a bonus this also fixes a similar scalability bottleneck in the
thread-exit codepath: profile_task_exit() ...

Signed-off-by: Ingo Molnar <mingo@elte.hu>
Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Acked-by: Nick Piggin <nickpiggin@yahoo.com.au>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-01-23 11:08:03 -08:00
..
2006-12-10 09:57:22 -08:00
2006-09-11 13:32:30 -04:00
2006-12-08 08:28:46 -08:00
2006-09-29 09:18:12 -07:00
2006-12-30 10:56:43 -08:00
2006-12-07 08:39:25 -08:00
2006-12-07 08:39:36 -08:00
2006-12-04 02:00:22 -05:00
2006-12-30 10:56:43 -08:00
2006-12-15 08:47:51 -08:00
2006-09-30 01:47:55 +02:00
2006-09-29 09:18:12 -07:00
2006-12-22 08:55:51 -08:00
2006-12-10 09:55:41 -08:00
2006-12-07 08:39:25 -08:00
2006-07-10 13:24:25 -07:00