Skip to content

Commit 55911a9

Browse files
Frederic Weisbeckerpaulmckrcu
authored andcommitted
rcu: Remove full memory barrier on RCU stall printout
RCU stall printout fetches the EQS state of a CPU with a preceding full memory barrier. However there is nothing to order this read against at this debugging stage. It is inherently racy when performed remotely. Do a plain read instead. This was the last user of rcu_dynticks_snap(). Signed-off-by: Frederic Weisbecker <[email protected]> Signed-off-by: Paul E. McKenney <[email protected]> Reviewed-by: Boqun Feng <[email protected]> Reviewed-by: Neeraj Upadhyay <[email protected]>
1 parent e7a3c8e commit 55911a9

File tree

2 files changed

+2
-12
lines changed

2 files changed

+2
-12
lines changed

kernel/rcu/tree.c

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -295,16 +295,6 @@ static void rcu_dynticks_eqs_online(void)
295295
ct_state_inc(RCU_DYNTICKS_IDX);
296296
}
297297

298-
/*
299-
* Snapshot the ->dynticks counter with full ordering so as to allow
300-
* stable comparison of this counter with past and future snapshots.
301-
*/
302-
static int rcu_dynticks_snap(int cpu)
303-
{
304-
smp_mb(); // Fundamental RCU ordering guarantee.
305-
return ct_dynticks_cpu_acquire(cpu);
306-
}
307-
308298
/*
309299
* Return true if the snapshot returned from rcu_dynticks_snap()
310300
* indicates that RCU is in an extended quiescent state.

kernel/rcu/tree_stall.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -501,7 +501,7 @@ static void print_cpu_stall_info(int cpu)
501501
}
502502
delta = rcu_seq_ctr(rdp->mynode->gp_seq - rdp->rcu_iw_gp_seq);
503503
falsepositive = rcu_is_gp_kthread_starving(NULL) &&
504-
rcu_dynticks_in_eqs(rcu_dynticks_snap(cpu));
504+
rcu_dynticks_in_eqs(ct_dynticks_cpu(cpu));
505505
rcuc_starved = rcu_is_rcuc_kthread_starving(rdp, &j);
506506
if (rcuc_starved)
507507
// Print signed value, as negative values indicate a probable bug.
@@ -515,7 +515,7 @@ static void print_cpu_stall_info(int cpu)
515515
rdp->rcu_iw_pending ? (int)min(delta, 9UL) + '0' :
516516
"!."[!delta],
517517
ticks_value, ticks_title,
518-
rcu_dynticks_snap(cpu) & 0xffff,
518+
ct_dynticks_cpu(cpu) & 0xffff,
519519
ct_dynticks_nesting_cpu(cpu), ct_dynticks_nmi_nesting_cpu(cpu),
520520
rdp->softirq_snap, kstat_softirqs_cpu(RCU_SOFTIRQ, cpu),
521521
data_race(rcu_state.n_force_qs) - rcu_state.n_force_qs_gpstart,

0 commit comments

Comments
 (0)