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

Commit d7c33c49 authored by Peter Zijlstra's avatar Peter Zijlstra Committed by Ingo Molnar
Browse files

sched: Fix task affinity for select_task_rq_fair



While merging select_task_rq_fair() and sched_balance_self() I made
a mistake that leads to testing the wrong task affinty.

Signed-off-by: default avatarPeter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <new-submission>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent 83f54960
Loading
Loading
Loading
Loading
+2 −3
Original line number Original line Diff line number Diff line
@@ -1318,7 +1318,6 @@ find_idlest_cpu(struct sched_group *group, struct task_struct *p, int this_cpu)
 */
 */
static int select_task_rq_fair(struct task_struct *p, int flag, int sync)
static int select_task_rq_fair(struct task_struct *p, int flag, int sync)
{
{
	struct task_struct *t = current;
	struct sched_domain *tmp, *sd = NULL;
	struct sched_domain *tmp, *sd = NULL;
	int cpu = smp_processor_id();
	int cpu = smp_processor_id();
	int prev_cpu = task_cpu(p);
	int prev_cpu = task_cpu(p);
@@ -1393,13 +1392,13 @@ static int select_task_rq_fair(struct task_struct *p, int flag, int sync)
			continue;
			continue;
		}
		}


		group = find_idlest_group(sd, t, cpu);
		group = find_idlest_group(sd, p, cpu);
		if (!group) {
		if (!group) {
			sd = sd->child;
			sd = sd->child;
			continue;
			continue;
		}
		}


		new_cpu = find_idlest_cpu(group, t, cpu);
		new_cpu = find_idlest_cpu(group, p, cpu);
		if (new_cpu == -1 || new_cpu == cpu) {
		if (new_cpu == -1 || new_cpu == cpu) {
			/* Now try balancing at a lower domain level of cpu */
			/* Now try balancing at a lower domain level of cpu */
			sd = sd->child;
			sd = sd->child;