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

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

Merge "sched: add preference for prev and sibling CPU in RT task placement"

parents 96dba852 0ec35511
Loading
Loading
Loading
Loading
+5 −1
Original line number Original line Diff line number Diff line
@@ -1651,6 +1651,7 @@ static int find_lowest_rq_hmp(struct task_struct *task)
	int cpu_cost, min_cost = INT_MAX;
	int cpu_cost, min_cost = INT_MAX;
	u64 cpu_load, min_load = ULLONG_MAX;
	u64 cpu_load, min_load = ULLONG_MAX;
	int best_cpu = -1;
	int best_cpu = -1;
	int prev_cpu = task_cpu(task);
	int i;
	int i;


	/* Make sure the mask is initialized first */
	/* Make sure the mask is initialized first */
@@ -1703,7 +1704,10 @@ static int find_lowest_rq_hmp(struct task_struct *task)
		if (sched_cpu_high_irqload(i))
		if (sched_cpu_high_irqload(i))
			continue;
			continue;


		if (cpu_load < min_load) {
		if (cpu_load < min_load ||
		    (cpu_load == min_load &&
		     (i == prev_cpu || (best_cpu != prev_cpu &&
					cpus_share_cache(prev_cpu, i))))) {
			min_load = cpu_load;
			min_load = cpu_load;
			best_cpu = i;
			best_cpu = i;
		}
		}