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 @@ -913,11 +913,22 @@ void tick_broadcast(const struct cpumask *mask)
913
913
}
914
914
#endif
915
915
916
+ /*
917
+ * The number of CPUs online, not counting this CPU (which may not be
918
+ * fully online and so not counted in num_online_cpus()).
919
+ */
920
+ static inline unsigned int num_other_online_cpus (void )
921
+ {
922
+ unsigned int this_cpu_online = cpu_online (smp_processor_id ());
923
+
924
+ return num_online_cpus () - this_cpu_online ;
925
+ }
926
+
916
927
void smp_send_stop (void )
917
928
{
918
929
unsigned long timeout ;
919
930
920
- if (num_online_cpus () > 1 ) {
931
+ if (num_other_online_cpus () ) {
921
932
cpumask_t mask ;
922
933
923
934
cpumask_copy (& mask , cpu_online_mask );
@@ -930,10 +941,10 @@ void smp_send_stop(void)
930
941
931
942
/* Wait up to one second for other CPUs to stop */
932
943
timeout = USEC_PER_SEC ;
933
- while (num_online_cpus () > 1 && timeout -- )
944
+ while (num_other_online_cpus () && timeout -- )
934
945
udelay (1 );
935
946
936
- if (num_online_cpus () > 1 )
947
+ if (num_other_online_cpus () )
937
948
pr_warning ("SMP: failed to stop secondary CPUs %*pbl\n" ,
938
949
cpumask_pr_args (cpu_online_mask ));
939
950
}
You can’t perform that action at this time.
0 commit comments