File tree 1 file changed +14
-3
lines changed 1 file changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -936,11 +936,22 @@ void tick_broadcast(const struct cpumask *mask)
936
936
}
937
937
#endif
938
938
939
+ /*
940
+ * The number of CPUs online, not counting this CPU (which may not be
941
+ * fully online and so not counted in num_online_cpus()).
942
+ */
943
+ static inline unsigned int num_other_online_cpus (void )
944
+ {
945
+ unsigned int this_cpu_online = cpu_online (smp_processor_id ());
946
+
947
+ return num_online_cpus () - this_cpu_online ;
948
+ }
949
+
939
950
void smp_send_stop (void )
940
951
{
941
952
unsigned long timeout ;
942
953
943
- if (num_online_cpus () > 1 ) {
954
+ if (num_other_online_cpus () ) {
944
955
cpumask_t mask ;
945
956
946
957
cpumask_copy (& mask , cpu_online_mask );
@@ -953,10 +964,10 @@ void smp_send_stop(void)
953
964
954
965
/* Wait up to one second for other CPUs to stop */
955
966
timeout = USEC_PER_SEC ;
956
- while (num_online_cpus () > 1 && timeout -- )
967
+ while (num_other_online_cpus () && timeout -- )
957
968
udelay (1 );
958
969
959
- if (num_online_cpus () > 1 )
970
+ if (num_other_online_cpus () )
960
971
pr_warning ("SMP: failed to stop secondary CPUs %*pbl\n" ,
961
972
cpumask_pr_args (cpu_online_mask ));
962
973
You can’t perform that action at this time.
0 commit comments