linux/tools/perf
Shaohua Li 09223371de rcu: Use softirq to address performance regression
Commit a26ac2455ffcf3(rcu: move TREE_RCU from softirq to kthread)
introduced performance regression. In an AIM7 test, this commit degraded
performance by about 40%.

The commit runs rcu callbacks in a kthread instead of softirq. We observed
high rate of context switch which is caused by this. Out test system has
64 CPUs and HZ is 1000, so we saw more than 64k context switch per second
which is caused by RCU's per-CPU kthread.  A trace showed that most of
the time the RCU per-CPU kthread doesn't actually handle any callbacks,
but instead just does a very small amount of work handling grace periods.
This means that RCU's per-CPU kthreads are making the scheduler do quite
a bit of work in order to allow a very small amount of RCU-related
processing to be done.

Alex Shi's analysis determined that this slowdown is due to lock
contention within the scheduler.  Unfortunately, as Peter Zijlstra points
out, the scheduler's real-time semantics require global action, which
means that this contention is inherent in real-time scheduling.  (Yes,
perhaps someone will come up with a workaround -- otherwise, -rt is not
going to do well on large SMP systems -- but this patch will work around
this issue in the meantime.  And "the meantime" might well be forever.)

This patch therefore re-introduces softirq processing to RCU, but only
for core RCU work.  RCU callbacks are still executed in kthread context,
so that only a small amount of RCU work runs in softirq context in the
common case.  This should minimize ksoftirqd execution, allowing us to
skip boosting of ksoftirqd for CONFIG_RCU_BOOST=y kernels.

Signed-off-by: Shaohua Li <shaohua.li@intel.com>
Tested-by: "Alex,Shi" <alex.shi@intel.com>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
2011-06-14 15:25:39 -07:00
..
Documentation Merge branches 'sched-core-for-linus' and 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip 2011-05-19 17:41:22 -07:00
arch [S390] perf: add DWARF register lookup for s390 2011-01-05 12:47:31 +01:00
bench perf tool: Fix gcc 4.6.0 issues 2011-02-07 12:41:41 -02:00
config perf tools: git mv tools/perf/{features-tests.mak,config/} 2011-04-19 08:18:36 -03:00
python perf evlist: Store pointer to the cpu and thread maps 2011-01-31 12:40:52 -02:00
scripts perf script: Finish the rename from trace to script 2010-12-25 11:29:02 -02:00
util rcu: Use softirq to address performance regression 2011-06-14 15:25:39 -07:00
.gitignore perf tools: Makefile: Remove various and sundry cruft 2011-02-18 07:43:06 -02:00
CREDITS
MANIFEST perf packaging: add memcpy to perf MANIFEST 2010-11-30 23:00:10 -02:00
Makefile perf tools: Fix build on older systems 2011-05-26 11:16:29 -03:00
builtin-annotate.c perf: Remove duplicate headers 2011-05-26 13:49:57 +02:00
builtin-bench.c perf options: Type check all the remaining OPT_ variants 2010-05-17 16:22:41 -03:00
builtin-buildid-cache.c perf buildid: add perfconfig option to specify buildid cache dir 2010-06-05 09:34:04 -03:00
builtin-buildid-list.c Merge commit 'v2.6.37-rc8' into perf/core 2011-01-04 08:08:54 +01:00
builtin-diff.c perf session: Pass evsel in event_ops->sample() 2011-03-23 19:28:58 -03:00
builtin-evlist.c perf evlist: New command to list the names of events present in a perf.data file 2011-03-15 11:10:48 -03:00
builtin-help.c perf options: Type check all the remaining OPT_ variants 2010-05-17 16:22:41 -03:00
builtin-inject.c perf session: Pass evsel in event_ops->sample() 2011-03-23 19:28:58 -03:00
builtin-kmem.c perf session: Pass evsel in event_ops->sample() 2011-03-23 19:28:58 -03:00
builtin-kvm.c perf options: Type check all the remaining OPT_ variants 2010-05-17 16:22:41 -03:00
builtin-list.c perf list: Allow filtering list of events 2011-02-17 15:38:58 -02:00
builtin-lock.c perf session: Pass evsel in event_ops->sample() 2011-03-23 19:28:58 -03:00
builtin-probe.c perf probe: Use %td for pointer arithmetic result 2011-01-31 19:45:38 -02:00
builtin-record.c perf tools: Make sure kptr_restrict warnings fit 80 col terms 2011-05-27 16:02:09 -03:00
builtin-report.c perf tools: Make sure kptr_restrict warnings fit 80 col terms 2011-05-27 16:02:09 -03:00
builtin-sched.c perf session: Pass evsel in event_ops->sample() 2011-03-23 19:28:58 -03:00
builtin-script.c perf: Remove duplicate headers 2011-05-26 13:49:57 +02:00
builtin-stat.c perf stat: Add more cache-miss percentage printouts 2011-05-19 14:30:50 +02:00
builtin-test.c Merge branch 'perf/core' of git://git.kernel.org/pub/scm/linux/kernel/git/frederic/random-tracing into perf/urgent 2011-05-22 10:10:01 +02:00
builtin-timechart.c perf session: Pass evsel in event_ops->sample() 2011-03-23 19:28:58 -03:00
builtin-top.c perf top: Don't stop if no kernel symtab is found 2011-05-27 16:02:29 -03:00
builtin.h perf evlist: New command to list the names of events present in a perf.data file 2011-03-15 11:10:48 -03:00
command-list.txt perf evlist: New command to list the names of events present in a perf.data file 2011-03-15 11:10:48 -03:00
design.txt perf: Fix few typos + cosmetics 2010-01-13 17:39:44 +01:00
perf-archive.sh perf buildid: add perfconfig option to specify buildid cache dir 2010-06-05 09:34:04 -03:00
perf.c perf evlist: New command to list the names of events present in a perf.data file 2011-03-15 11:10:48 -03:00
perf.h perf record: Move perf_mmap__write_tail to perf.h 2011-01-22 19:56:29 -02:00