Skip to content

Commit 2eb52fa

Browse files
paulmckrcufbq
authored andcommitted
rcu-tasks: Repair RCU Tasks Trace quiescence check
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 <rostedt@goodmis.org> Signed-off-by: Paul E. McKenney <paulmck@kernel.org> Tested-by: Steven Rostedt (Google) <rostedt@goodmis.org> Signed-off-by: Boqun Feng <boqun.feng@gmail.com>
1 parent 41bccc9 commit 2eb52fa

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

include/linux/rcupdate.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,9 +184,9 @@ void rcu_tasks_trace_qs_blkd(struct task_struct *t);
184184
do { \
185185
int ___rttq_nesting = READ_ONCE((t)->trc_reader_nesting); \
186186
\
187-
if (likely(!READ_ONCE((t)->trc_reader_special.b.need_qs)) && \
187+
if (unlikely(READ_ONCE((t)->trc_reader_special.b.need_qs) == TRC_NEED_QS) && \
188188
likely(!___rttq_nesting)) { \
189-
rcu_trc_cmpxchg_need_qs((t), 0, TRC_NEED_QS_CHECKED); \
189+
rcu_trc_cmpxchg_need_qs((t), TRC_NEED_QS, TRC_NEED_QS_CHECKED); \
190190
} else if (___rttq_nesting && ___rttq_nesting != INT_MIN && \
191191
!READ_ONCE((t)->trc_reader_special.b.blocked)) { \
192192
rcu_tasks_trace_qs_blkd(t); \

0 commit comments

Comments
 (0)