Skip to content

Commit bca4fa8

Browse files
qiangzh3paulmckrcu
authored andcommitted
rcu: Update rcu_preempt_deferred_qs() comments for !PREEMPT kernels
In non-premptible kernels, tasks never do context switches within RCU read-side critical sections. Therefore, in such kernels, each leaf rcu_node structure's ->blkd_tasks list will always be empty. The comment on the non-preemptible version of rcu_preempt_deferred_qs() confuses this point, so this commit therefore fixes it. Signed-off-by: Zqiang <qiang1.zhang@intel.com> Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
1 parent 6d60ea0 commit bca4fa8

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

kernel/rcu/tree_plugin.h

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -932,10 +932,13 @@ static notrace bool rcu_preempt_need_deferred_qs(struct task_struct *t)
932932
return false;
933933
}
934934

935-
// Except that we do need to respond to a request by an expedited grace
936-
// period for a quiescent state from this CPU. Note that requests from
937-
// tasks are handled when removing the task from the blocked-tasks list
938-
// below.
935+
// Except that we do need to respond to a request by an expedited
936+
// grace period for a quiescent state from this CPU. Note that in
937+
// non-preemptible kernels, there can be no context switches within RCU
938+
// read-side critical sections, which in turn means that the leaf rcu_node
939+
// structure's blocked-tasks list is always empty. is therefore no need to
940+
// actually check it. Instead, a quiescent state from this CPU suffices,
941+
// and this function is only called from such a quiescent state.
939942
notrace void rcu_preempt_deferred_qs(struct task_struct *t)
940943
{
941944
struct rcu_data *rdp = this_cpu_ptr(&rcu_data);

0 commit comments

Comments
 (0)