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 @@ -901,11 +901,22 @@ void tick_broadcast(const struct cpumask *mask)
901901}
902902#endif
903903
904+ /*
905+ * The number of CPUs online, not counting this CPU (which may not be
906+ * fully online and so not counted in num_online_cpus()).
907+ */
908+ static inline unsigned int num_other_online_cpus (void )
909+ {
910+ unsigned int this_cpu_online = cpu_online (smp_processor_id ());
911+
912+ return num_online_cpus () - this_cpu_online ;
913+ }
914+
904915void smp_send_stop (void )
905916{
906917 unsigned long timeout ;
907918
908- if (num_online_cpus () > 1 ) {
919+ if (num_other_online_cpus () ) {
909920 cpumask_t mask ;
910921
911922 cpumask_copy (& mask , cpu_online_mask );
@@ -919,10 +930,10 @@ void smp_send_stop(void)
919930
920931 /* Wait up to one second for other CPUs to stop */
921932 timeout = USEC_PER_SEC ;
922- while (num_online_cpus () > 1 && timeout -- )
933+ while (num_other_online_cpus () && timeout -- )
923934 udelay (1 );
924935
925- if (num_online_cpus () > 1 )
936+ if (num_other_online_cpus () )
926937 pr_warning ("SMP: failed to stop secondary CPUs %*pbl\n" ,
927938 cpumask_pr_args (cpu_online_mask ));
928939}
You can’t perform that action at this time.
0 commit comments