]> asedeno.scripts.mit.edu Git - linux.git/commit
rcu: Mark task as .need_qs less aggressively
authorPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Wed, 16 May 2018 21:41:41 +0000 (14:41 -0700)
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Thu, 12 Jul 2018 22:39:15 +0000 (15:39 -0700)
commit15651201fa055ec81d3669b36ab7c2fb12c3ce36
treeef8bfa5efe7b09c8695423613d2bb368e8e1fa43
parent6f56f714db067056c80f5d71510118f82872e34c
rcu: Mark task as .need_qs less aggressively

If any scheduling-clock interrupt interrupts an RCU-preempt read-side
critical section, the interrupted task's ->rcu_read_unlock_special.b.need_qs
field is set.  This causes the outermost rcu_read_unlock() to incur the
extra overhead of calling into rcu_read_unlock_special().  This commit
reduces that overhead by setting ->rcu_read_unlock_special.b.need_qs only
if the grace period has been in effect for more than one second.

Why one second?  Because this is comfortably smaller than the minimum
RCU CPU stall-warning timeout of three seconds, but long enough that the
.need_qs marking should happen quite rarely.  And if your RCU read-side
critical section has run on-CPU for a full second, it is not unreasonable
to invest some CPU time in ending the grace period quickly.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
kernel/rcu/tree_plugin.h