diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index d6f389a7116e..70cb1b0abe20 100755 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -6655,9 +6655,15 @@ wake_affine_idle(int this_cpu, int prev_cpu, int sync) * context. Only allow the move if cache is shared. Otherwise an * interrupt intensive workload could force all tasks onto one * node depending on the IO topology or IRQ affinity settings. + * + * If the prev_cpu is idle and cache affine then avoid a migration. + * There is no guarantee that the cache hot data from an interrupt + * is more important than cache hot data on the prev_cpu and from + * a cpufreq perspective, it's better to have higher utilisation + * on one CPU. */ if (idle_cpu(this_cpu) && cpus_share_cache(this_cpu, prev_cpu)) - return this_cpu; + return idle_cpu(prev_cpu) ? prev_cpu : this_cpu; if (sync && cpu_rq(this_cpu)->nr_running == 1) return this_cpu;