rcu: Move rcu_report_unblock_qs_rnp() to common code
authorPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Mon, 23 Feb 2015 16:59:29 +0000 (08:59 -0800)
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Thu, 12 Mar 2015 22:19:36 +0000 (15:19 -0700)
commitcc99a310caf811aebbd0986f433d824e4a5e7ce5
tree2ab92ffc88d89991bd6b18216cdf60830445a777
parent8eb74b2b291e7bf6aa59fcb4e59f236382f00bf5
rcu: Move rcu_report_unblock_qs_rnp() to common code

The rcu_report_unblock_qs_rnp() function is invoked when the
last task blocking the current grace period exits its outermost
RCU read-side critical section.  Previously, this was called only
from rcu_read_unlock_special(), and was therefore defined only when
CONFIG_RCU_PREEMPT=y.  However, this function will be invoked even when
CONFIG_RCU_PREEMPT=n once CPU-hotplug operations are processed only at
the beginnings of RCU grace periods.  The reason for this change is that
the last task on a given leaf rcu_node structure's ->blkd_tasks list
might well exit its RCU read-side critical section between the time that
recent CPU-hotplug operations were applied and when the new grace period
was initialized.  This situation could result in RCU waiting forever on
that leaf rcu_node structure, because if all that structure's CPUs were
already offline, there would be no quiescent-state events to drive that
structure's part of the grace period.

This commit therefore moves rcu_report_unblock_qs_rnp() to common code
that is built unconditionally so that the quiescent-state-forcing code
can clean up after this situation, avoiding the grace-period stall.

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