diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 76ca867449bc..19da937f4ae6 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -3817,7 +3817,7 @@ util_est_dequeue(struct cfs_rq *cfs_rq, struct task_struct *p, bool task_sleep) } static inline bool -bias_to_waker_cpu(struct task_struct *p, int cpu, int start_cpu) +bias_to_this_cpu(struct task_struct *p, int cpu, int start_cpu) { bool base_test = cpumask_test_cpu(cpu, &p->cpus_mask) && cpu_active(cpu); @@ -6430,6 +6430,7 @@ enum fastpaths { NONE = 0, SYNC_WAKEUP, PREV_CPU_FASTPATH, + MANY_WAKEUP, }; static void find_best_target(struct sched_domain *sd, cpumask_t *cpus, @@ -7029,10 +7030,17 @@ int find_energy_efficient_cpu(struct task_struct *p, int prev_cpu, if (need_idle) sync = 0; - if (sync && bias_to_waker_cpu(p, cpu, start_cpu)) { + if (sync && bias_to_this_cpu(p, cpu, start_cpu)) { best_energy_cpu = cpu; fbt_env.fastpath = SYNC_WAKEUP; - goto sync_wakeup; + goto done; + } + + if (is_many_wakeup(sibling_count_hint) && prev_cpu != cpu && + bias_to_this_cpu(p, prev_cpu, start_cpu)) { + best_energy_cpu = prev_cpu; + fbt_env.fastpath = MANY_WAKEUP; + goto done; } rcu_read_lock(); @@ -7214,7 +7222,7 @@ unlock: (capacity_orig_of(prev_cpu) <= capacity_orig_of(start_cpu))) best_energy_cpu = prev_cpu; -sync_wakeup: +done: trace_sched_task_util(p, cpumask_bits(candidates)[0], best_energy_cpu, sync, need_idle, fbt_env.fastpath, placement_boost, start_t, boosted, is_rtg, get_rtg_status(p), start_cpu);