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 @@ -958,11 +958,22 @@ void tick_broadcast(const struct cpumask *mask)
958
958
}
959
959
#endif
960
960
961
+ /*
962
+ * The number of CPUs online, not counting this CPU (which may not be
963
+ * fully online and so not counted in num_online_cpus()).
964
+ */
965
+ static inline unsigned int num_other_online_cpus (void )
966
+ {
967
+ unsigned int this_cpu_online = cpu_online (smp_processor_id ());
968
+
969
+ return num_online_cpus () - this_cpu_online ;
970
+ }
971
+
961
972
void smp_send_stop (void )
962
973
{
963
974
unsigned long timeout ;
964
975
965
- if (num_online_cpus () > 1 ) {
976
+ if (num_other_online_cpus () ) {
966
977
cpumask_t mask ;
967
978
968
979
cpumask_copy (& mask , cpu_online_mask );
@@ -975,10 +986,10 @@ void smp_send_stop(void)
975
986
976
987
/* Wait up to one second for other CPUs to stop */
977
988
timeout = USEC_PER_SEC ;
978
- while (num_online_cpus () > 1 && timeout -- )
989
+ while (num_other_online_cpus () && timeout -- )
979
990
udelay (1 );
980
991
981
- if (num_online_cpus () > 1 )
992
+ if (num_other_online_cpus () )
982
993
pr_warn ("SMP: failed to stop secondary CPUs %*pbl\n" ,
983
994
cpumask_pr_args (cpu_online_mask ));
984
995
You can’t perform that action at this time.
0 commit comments