@@ -711,7 +711,7 @@ static void print_cpu_stall(unsigned long gps)
711
711
712
712
static void check_cpu_stall (struct rcu_data * rdp )
713
713
{
714
- bool didstall = false ;
714
+ bool self_detected ;
715
715
unsigned long gs1 ;
716
716
unsigned long gs2 ;
717
717
unsigned long gps ;
@@ -758,10 +758,10 @@ static void check_cpu_stall(struct rcu_data *rdp)
758
758
return ; /* No stall or GP completed since entering function. */
759
759
rnp = rdp -> mynode ;
760
760
jn = jiffies + ULONG_MAX / 2 ;
761
+ self_detected = READ_ONCE (rnp -> qsmask ) & rdp -> grpmask ;
761
762
if (rcu_gp_in_progress () &&
762
- (READ_ONCE ( rnp -> qsmask ) & rdp -> grpmask ) &&
763
+ (self_detected || ULONG_CMP_GE ( j , js + RCU_STALL_RAT_DELAY ) ) &&
763
764
cmpxchg (& rcu_state .jiffies_stall , js , jn ) == js ) {
764
-
765
765
/*
766
766
* If a virtual machine is stopped by the host it can look to
767
767
* the watchdog like an RCU stall. Check to see if the host
@@ -770,33 +770,21 @@ static void check_cpu_stall(struct rcu_data *rdp)
770
770
if (kvm_check_and_clear_guest_paused ())
771
771
return ;
772
772
773
- /* We haven't checked in, so go dump stack. */
774
- print_cpu_stall (gps );
775
- if (READ_ONCE (rcu_cpu_stall_ftrace_dump ))
776
- rcu_ftrace_dump (DUMP_ALL );
777
- didstall = true;
778
-
779
- } else if (rcu_gp_in_progress () &&
780
- ULONG_CMP_GE (j , js + RCU_STALL_RAT_DELAY ) &&
781
- cmpxchg (& rcu_state .jiffies_stall , js , jn ) == js ) {
782
-
783
- /*
784
- * If a virtual machine is stopped by the host it can look to
785
- * the watchdog like an RCU stall. Check to see if the host
786
- * stopped the vm.
787
- */
788
- if (kvm_check_and_clear_guest_paused ())
789
- return ;
773
+ if (self_detected ) {
774
+ /* We haven't checked in, so go dump stack. */
775
+ print_cpu_stall (gps );
776
+ } else {
777
+ /* They had a few time units to dump stack, so complain. */
778
+ print_other_cpu_stall (gs2 , gps );
779
+ }
790
780
791
- /* They had a few time units to dump stack, so complain. */
792
- print_other_cpu_stall (gs2 , gps );
793
781
if (READ_ONCE (rcu_cpu_stall_ftrace_dump ))
794
782
rcu_ftrace_dump (DUMP_ALL );
795
- didstall = true;
796
- }
797
- if ( didstall && READ_ONCE ( rcu_state . jiffies_stall ) == jn ) {
798
- jn = jiffies + 3 * rcu_jiffies_till_stall_check () + 3 ;
799
- WRITE_ONCE ( rcu_state . jiffies_stall , jn );
783
+
784
+ if ( READ_ONCE ( rcu_state . jiffies_stall ) == jn ) {
785
+ jn = jiffies + 3 * rcu_jiffies_till_stall_check () + 3 ;
786
+ WRITE_ONCE ( rcu_state . jiffies_stall , jn ) ;
787
+ }
800
788
}
801
789
}
802
790
0 commit comments