Skip to content

Commit 24e5e1e

Browse files
paulmckrcugregkh
authored andcommitted
rcu-tasks: Repair RCU Tasks Trace quiescence check
[ Upstream commit 2eb52fa ] The context-switch-time check for RCU Tasks Trace quiescence expects current->trc_reader_special.b.need_qs to be zero, and if so, updates it to TRC_NEED_QS_CHECKED. This is backwards, because if this value is zero, there is no RCU Tasks Trace grace period in flight, an thus no need for a quiescent state. Instead, when a grace period starts, this field is set to TRC_NEED_QS. This commit therefore changes the check from zero to TRC_NEED_QS. Reported-by: Steven Rostedt <[email protected]> Signed-off-by: Paul E. McKenney <[email protected]> Tested-by: Steven Rostedt (Google) <[email protected]> Signed-off-by: Boqun Feng <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent 4d58c9f commit 24e5e1e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

include/linux/rcupdate.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -189,9 +189,9 @@ void rcu_tasks_trace_qs_blkd(struct task_struct *t);
189189
do { \
190190
int ___rttq_nesting = READ_ONCE((t)->trc_reader_nesting); \
191191
\
192-
if (likely(!READ_ONCE((t)->trc_reader_special.b.need_qs)) && \
192+
if (unlikely(READ_ONCE((t)->trc_reader_special.b.need_qs) == TRC_NEED_QS) && \
193193
likely(!___rttq_nesting)) { \
194-
rcu_trc_cmpxchg_need_qs((t), 0, TRC_NEED_QS_CHECKED); \
194+
rcu_trc_cmpxchg_need_qs((t), TRC_NEED_QS, TRC_NEED_QS_CHECKED); \
195195
} else if (___rttq_nesting && ___rttq_nesting != INT_MIN && \
196196
!READ_ONCE((t)->trc_reader_special.b.blocked)) { \
197197
rcu_tasks_trace_qs_blkd(t); \

0 commit comments

Comments
 (0)