Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e97f6b18 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "sched: run sync wakeup small tasks on current CPU when possible"

parents 7549c10e d05c5eb2
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -1715,12 +1715,21 @@ static int best_small_task_cpu(struct task_struct *p, int sync)
	u64 load;
	int cost_list[nr_cpu_ids];
	struct cpumask search_cpus;
	int cpu = smp_processor_id();

	cpumask_and(&search_cpus,  tsk_cpus_allowed(p), cpu_online_mask);

	if (cpumask_empty(&search_cpus))
		return task_cpu(p);

	/*
	 * If a CPU is doing a sync wakeup and it only has one currently
	 * running task, just run the waking small task on that CPU regardless
	 * of what type of CPU it is.
	 */
	if (sync && cpu_rq(cpu)->nr_running == 1)
		return cpu;

	/* Take a first pass to find the lowest power cost CPU. This
	   will avoid a potential O(n^2) search */
	for_each_cpu(i, &search_cpus) {