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

Commit 32061ff6 authored by Qais Yousef's avatar Qais Yousef
Browse files

FROMGIT: sched/rt: Remove unnecessary push for unfit tasks

In task_woken_rt() and switched_to_rto() we try trigger push-pull if the
task is unfit.

But the logic is found lacking because if the task was the only one
running on the CPU, then rt_rq is not in overloaded state and won't
trigger a push.

The necessity of this logic was under a debate as well, a summary of
the discussion can be found in the following thread:

  https://lore.kernel.org/lkml/20200226160247.iqvdakiqbakk2llz@e107158-lin.cambridge.arm.com/



Remove the logic for now until a better approach is agreed upon.

Bug: 120440300
Signed-off-by: default avatarQais Yousef <qais.yousef@arm.com>
Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
Fixes: 804d402fb6f6 ("sched/rt: Make RT capacity-aware")
Link: https://lkml.kernel.org/r/20200302132721.8353-6-qais.yousef@arm.com
(cherry picked from commit d94a9df49069ba8ff7c4aaeca1229e6471a01a15
 https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git

 sched/core)
Signed-off-by: default avatarQais Yousef <qais.yousef@arm.com>
Change-Id: Id120ada4a89972b3feb8d8b022babb98db1a157f
parent 8efce171
Loading
Loading
Loading
Loading
+2 −5
Original line number Diff line number Diff line
@@ -2242,7 +2242,7 @@ static void task_woken_rt(struct rq *rq, struct task_struct *p)
			    (rq->curr->nr_cpus_allowed < 2 ||
			     rq->curr->prio <= p->prio);

	if (need_to_push || !rt_task_fits_capacity(p, cpu_of(rq)))
	if (need_to_push)
		push_rt_tasks(rq);
}

@@ -2314,10 +2314,7 @@ static void switched_to_rt(struct rq *rq, struct task_struct *p)
	 */
	if (task_on_rq_queued(p) && rq->curr != p) {
#ifdef CONFIG_SMP
		bool need_to_push = rq->rt.overloaded ||
				    !rt_task_fits_capacity(p, cpu_of(rq));

		if (p->nr_cpus_allowed > 1 && need_to_push)
		if (p->nr_cpus_allowed > 1 && rq->rt.overloaded)
			rt_queue_push_tasks(rq);
#endif /* CONFIG_SMP */
		if (p->prio < rq->curr->prio && cpu_online(cpu_of(rq)))