@@ -592,21 +592,22 @@ void show_rcu_gp_kthreads(void)
592
592
(long )READ_ONCE (rcu_get_root ()-> gp_seq_needed ),
593
593
READ_ONCE (rcu_state .gp_flags ));
594
594
rcu_for_each_node_breadth_first (rnp ) {
595
- if (ULONG_CMP_GE (rcu_state .gp_seq , rnp -> gp_seq_needed ))
595
+ if (ULONG_CMP_GE (READ_ONCE (rcu_state .gp_seq ),
596
+ READ_ONCE (rnp -> gp_seq_needed )))
596
597
continue ;
597
598
pr_info ("\trcu_node %d:%d ->gp_seq %ld ->gp_seq_needed %ld\n" ,
598
- rnp -> grplo , rnp -> grphi , (long )rnp -> gp_seq ,
599
- (long )rnp -> gp_seq_needed );
599
+ rnp -> grplo , rnp -> grphi , (long )READ_ONCE ( rnp -> gp_seq ) ,
600
+ (long )READ_ONCE ( rnp -> gp_seq_needed ) );
600
601
if (!rcu_is_leaf_node (rnp ))
601
602
continue ;
602
603
for_each_leaf_node_possible_cpu (rnp , cpu ) {
603
604
rdp = per_cpu_ptr (& rcu_data , cpu );
604
605
if (rdp -> gpwrap ||
605
- ULONG_CMP_GE (rcu_state .gp_seq ,
606
- rdp -> gp_seq_needed ))
606
+ ULONG_CMP_GE (READ_ONCE ( rcu_state .gp_seq ) ,
607
+ READ_ONCE ( rdp -> gp_seq_needed ) ))
607
608
continue ;
608
609
pr_info ("\tcpu %d ->gp_seq_needed %ld\n" ,
609
- cpu , (long )rdp -> gp_seq_needed );
610
+ cpu , (long )READ_ONCE ( rdp -> gp_seq_needed ) );
610
611
}
611
612
}
612
613
for_each_possible_cpu (cpu ) {
@@ -631,7 +632,8 @@ static void rcu_check_gp_start_stall(struct rcu_node *rnp, struct rcu_data *rdp,
631
632
static atomic_t warned = ATOMIC_INIT (0 );
632
633
633
634
if (!IS_ENABLED (CONFIG_PROVE_RCU ) || rcu_gp_in_progress () ||
634
- ULONG_CMP_GE (rnp_root -> gp_seq , rnp_root -> gp_seq_needed ))
635
+ ULONG_CMP_GE (READ_ONCE (rnp_root -> gp_seq ),
636
+ READ_ONCE (rnp_root -> gp_seq_needed )))
635
637
return ;
636
638
j = jiffies ; /* Expensive access, and in common case don't get here. */
637
639
if (time_before (j , READ_ONCE (rcu_state .gp_req_activity ) + gpssdelay ) ||
@@ -642,7 +644,8 @@ static void rcu_check_gp_start_stall(struct rcu_node *rnp, struct rcu_data *rdp,
642
644
raw_spin_lock_irqsave_rcu_node (rnp , flags );
643
645
j = jiffies ;
644
646
if (rcu_gp_in_progress () ||
645
- ULONG_CMP_GE (rnp_root -> gp_seq , rnp_root -> gp_seq_needed ) ||
647
+ ULONG_CMP_GE (READ_ONCE (rnp_root -> gp_seq ),
648
+ READ_ONCE (rnp_root -> gp_seq_needed )) ||
646
649
time_before (j , READ_ONCE (rcu_state .gp_req_activity ) + gpssdelay ) ||
647
650
time_before (j , READ_ONCE (rcu_state .gp_activity ) + gpssdelay ) ||
648
651
atomic_read (& warned )) {
@@ -655,9 +658,10 @@ static void rcu_check_gp_start_stall(struct rcu_node *rnp, struct rcu_data *rdp,
655
658
raw_spin_lock_rcu_node (rnp_root ); /* irqs already disabled. */
656
659
j = jiffies ;
657
660
if (rcu_gp_in_progress () ||
658
- ULONG_CMP_GE (rnp_root -> gp_seq , rnp_root -> gp_seq_needed ) ||
659
- time_before (j , rcu_state .gp_req_activity + gpssdelay ) ||
660
- time_before (j , rcu_state .gp_activity + gpssdelay ) ||
661
+ ULONG_CMP_GE (READ_ONCE (rnp_root -> gp_seq ),
662
+ READ_ONCE (rnp_root -> gp_seq_needed )) ||
663
+ time_before (j , READ_ONCE (rcu_state .gp_req_activity ) + gpssdelay ) ||
664
+ time_before (j , READ_ONCE (rcu_state .gp_activity ) + gpssdelay ) ||
661
665
atomic_xchg (& warned , 1 )) {
662
666
if (rnp_root != rnp )
663
667
/* irqs remain disabled. */
0 commit comments