From 8efce1718768a6729b2923b586c00c6192557d40 Mon Sep 17 00:00:00 2001 From: Qais Yousef Date: Mon, 2 Mar 2020 13:27:19 +0000 Subject: [PATCH] BACKPORT: FROMGIT: sched/rt: Allow pulling unfitting task When implemented RT Capacity Awareness; the logic was done such that if a task was running on a fitting CPU, then it was sticky and we would try our best to keep it there. But as Steve suggested, to adhere to the strict priority rules of RT class; allow pulling an RT task to unfitting CPU to ensure it gets a chance to run ASAP. Bug: 120440300 LINK: https://lore.kernel.org/lkml/20200203111451.0d1da58f@oasis.local.home/ Suggested-by: Steven Rostedt Signed-off-by: Qais Yousef Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Fixes: 804d402fb6f6 ("sched/rt: Make RT capacity-aware") Link: https://lkml.kernel.org/r/20200302132721.8353-5-qais.yousef@arm.com (cherry picked from commit 98ca645f824301bde72e0a51cdc8bdbbea6774a5 https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git sched/core) [Trivial merge conflict] Signed-off-by: Qais Yousef Change-Id: Ie25fa5a4f3b0979ed06df8d156e5586b2928479e --- kernel/sched/rt.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c index 125a810f882c..6b355d94610e 100644 --- a/kernel/sched/rt.c +++ b/kernel/sched/rt.c @@ -1671,8 +1671,7 @@ static void put_prev_task_rt(struct rq *rq, struct task_struct *p) static int pick_rt_task(struct rq *rq, struct task_struct *p, int cpu) { if (!task_running(rq, p) && - cpumask_test_cpu(cpu, &p->cpus_allowed) && - rt_task_fits_capacity(p, cpu)) + cpumask_test_cpu(cpu, &p->cpus_allowed)) return 1; return 0;