Paul E. McKenney 4a81e8328d rcu: Reduce overhead of cond_resched() checks for RCU
Commit ac1bea85781e (Make cond_resched() report RCU quiescent states)
fixed a problem where a CPU looping in the kernel with but one runnable
task would give RCU CPU stall warnings, even if the in-kernel loop
contained cond_resched() calls.  Unfortunately, in so doing, it introduced
performance regressions in Anton Blanchard's will-it-scale "open1" test.
The problem appears to be not so much the increased cond_resched() path
length as an increase in the rate at which grace periods complete, which
increased per-update grace-period overhead.

This commit takes a different approach to fixing this bug, mainly by
moving the RCU-visible quiescent state from cond_resched() to
rcu_note_context_switch(), and by further reducing the check to a
simple non-zero test of a single per-CPU variable.  However, this
approach requires that the force-quiescent-state processing send
resched IPIs to the offending CPUs.  These will be sent only once
the grace period has reached an age specified by the boot/sysfs
parameter rcutree.jiffies_till_sched_qs, or once the grace period
reaches an age halfway to the point at which RCU CPU stall warnings
will be emitted, whichever comes first.

Reported-by: Dave Hansen <dave.hansen@intel.com>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Christoph Lameter <cl@gentwo.org>
Cc: Mike Galbraith <umgwanakikbuti@gmail.com>
Cc: Eric Dumazet <eric.dumazet@gmail.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
[ paulmck: Made rcu_momentary_dyntick_idle() as suggested by the
  ktest build robot.  Also fixed smp_mb() comment as noted by
  Oleg Nesterov. ]

Merge with e552592e (Reduce overhead of cond_resched() checks for RCU)

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
2014-06-23 11:19:32 -07:00
..
2014-06-11 08:35:34 -07:00
2014-06-10 15:02:42 -07:00
2014-06-03 23:12:20 +02:00
2014-06-06 07:57:37 -06:00
2014-06-10 13:13:11 -06:00
2014-06-04 13:34:30 +09:00
2014-06-11 00:13:16 -07:00
2014-05-20 10:30:40 +09:00
2014-06-06 16:08:13 -07:00
2014-06-02 16:05:24 -07:00
2014-06-02 14:56:01 -07:00
2014-05-16 14:05:22 +02:00
2014-05-27 17:38:11 -07:00
2014-06-04 10:02:38 -07:00
2014-06-10 14:35:22 -07:00
2014-06-10 14:35:22 -07:00
2014-06-02 16:18:48 -06:00
2014-06-04 16:54:07 -07:00
2014-06-04 16:54:21 -07:00
2014-06-04 16:54:12 -07:00
2014-05-20 15:19:25 -05:00
2014-06-06 16:08:12 -07:00
2014-06-15 01:00:50 -07:00
2014-06-12 00:21:11 -04:00
2014-06-04 16:53:57 -07:00
2014-06-04 16:53:56 -07:00
2014-05-14 09:46:32 -07:00
2014-05-30 11:35:54 -06:00
2014-06-04 16:53:57 -07:00
2014-06-04 16:53:57 -07:00