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 @@ -901,11 +901,22 @@ void tick_broadcast(const struct cpumask *mask)
901
901
}
902
902
#endif
903
903
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
+
904
915
void smp_send_stop (void )
905
916
{
906
917
unsigned long timeout ;
907
918
908
- if (num_online_cpus () > 1 ) {
919
+ if (num_other_online_cpus () ) {
909
920
cpumask_t mask ;
910
921
911
922
cpumask_copy (& mask , cpu_online_mask );
@@ -919,10 +930,10 @@ void smp_send_stop(void)
919
930
920
931
/* Wait up to one second for other CPUs to stop */
921
932
timeout = USEC_PER_SEC ;
922
- while (num_online_cpus () > 1 && timeout -- )
933
+ while (num_other_online_cpus () && timeout -- )
923
934
udelay (1 );
924
935
925
- if (num_online_cpus () > 1 )
936
+ if (num_other_online_cpus () )
926
937
pr_warning ("SMP: failed to stop secondary CPUs %*pbl\n" ,
927
938
cpumask_pr_args (cpu_online_mask ));
928
939
}
You can’t perform that action at this time.
0 commit comments