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

Commit 58cc9909 authored by Pavankumar Kondeti's avatar Pavankumar Kondeti
Browse files

sched/fair: Make tick path active migration more robust



When a misfit task is marked for an active migration to a higher
capacity CPU from the tick path, don't allow this task to be
migrated to other CPUs from load balancer. This fixes the problem
described below.

(1) Task-A is running on CPU#0. This task does not fit on CPU#0
(2) Task-A is marked for an active migration to CPU#4 from the
tick path.
(3) migration/0 is woken up on CPU#0 to push the Task-A to CPU#4.
(4) CPU#0 has now two runnable tasks. migration/0 is just scheduled
in.
(5) Before migration/0 actually pushes the task to CPU#4, another
CPU lets say CPU#1 whose capacity is same as CPU#0 is pulling the
Task-A.
(6) The Task-A misses an opportunity for upmigration.

Change-Id: I7cc290f3f475caba73df9e7067b44e690c6f2ed7
Signed-off-by: default avatarPavankumar Kondeti <pkondeti@codeaurora.org>
parent 1252d8e6
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -8565,6 +8565,10 @@ int can_migrate_task(struct task_struct *p, struct lb_env *env)
		return 0;
	}

	/* Don't detach task if it is under active migration */
	if (env->src_rq->push_task == p)
		return 0;

	/*
	 * Aggressive migration if:
	 * 1) IDLE or NEWLY_IDLE balance.