It is possible for find_new_ilb() to select the current CPU, however, this only happens from newidle balancing, in which case need_resched() will be true, and consequently nohz_csd_func() will not trigger the softirq. Exclude the current CPU from becoming an ILB target.
Showing the changes to kernel (1 of 1 file). Show all
Unified · Split
| @@ -10056,6 +10056,10 @@ static inline int find_new_ilb(void) · 10055 unmodified lines | |||
| 10056 | 10056 | ||
| 10057 | for_each_cpu_and(ilb, nohz.idle_cpus_mask, | 10057 | for_each_cpu_and(ilb, nohz.idle_cpus_mask, |
| 10058 | housekeeping_cpumask(HK_FLAG_MISC)) { | 10058 | housekeeping_cpumask(HK_FLAG_MISC)) { |
| 10059 | |||
| 10060 | if (ilb == smp_processor_id()) | ||
| 10061 | continue; | ||
| 10062 | |||
| 10059 | if (idle_cpu(ilb)) | 10063 | if (idle_cpu(ilb)) |
| 10060 | return ilb; | 10064 | return ilb; |
| 10061 | } | 10065 | } |