File tree Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Expand file tree Collapse file tree 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)
913913}
914914#endif
915915
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+
916927void smp_send_stop (void )
917928{
918929 unsigned long timeout ;
919930
920- if (num_online_cpus () > 1 ) {
931+ if (num_other_online_cpus () ) {
921932 cpumask_t mask ;
922933
923934 cpumask_copy (& mask , cpu_online_mask );
@@ -930,10 +941,10 @@ void smp_send_stop(void)
930941
931942 /* Wait up to one second for other CPUs to stop */
932943 timeout = USEC_PER_SEC ;
933- while (num_online_cpus () > 1 && timeout -- )
944+ while (num_other_online_cpus () && timeout -- )
934945 udelay (1 );
935946
936- if (num_online_cpus () > 1 )
947+ if (num_other_online_cpus () )
937948 pr_warning ("SMP: failed to stop secondary CPUs %*pbl\n" ,
938949 cpumask_pr_args (cpu_online_mask ));
939950}
You can’t perform that action at this time.
0 commit comments