linux/debian/patches-rt/0229-sched-Allow-pinned-use...

43 lines
1.7 KiB
Diff
Raw Permalink Normal View History

2020-10-12 12:52:06 +00:00
From f8b5196327b0e22ac852740408737cb40515c72c Mon Sep 17 00:00:00 2001
Message-Id: <f8b5196327b0e22ac852740408737cb40515c72c.1601675152.git.zanussi@kernel.org>
In-Reply-To: <5b5a156f9808b1acf1205606e03da117214549ea.1601675151.git.zanussi@kernel.org>
References: <5b5a156f9808b1acf1205606e03da117214549ea.1601675151.git.zanussi@kernel.org>
2018-08-31 15:16:36 +00:00
From: Mike Galbraith <efault@gmx.de>
Date: Sun, 19 Aug 2018 08:28:35 +0200
2020-09-04 20:10:21 +00:00
Subject: [PATCH 229/333] sched: Allow pinned user tasks to be awakened to the
2019-04-08 23:49:20 +00:00
CPU they pinned
2020-10-12 12:52:06 +00:00
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.148-rt64.tar.xz
2018-08-31 15:16:36 +00:00
Since commit 7af443ee16976 ("sched/core: Require cpu_active() in
select_task_rq(), for user tasks") select_fallback_rq() will BUG() if
the CPU to which a task has pinned itself and pinned becomes
!cpu_active() while it slept.
The task will continue running on the to-be-removed CPU and will remove
itself from the CPU during takedown_cpu() (while cpuhp_pin_lock will be
acquired) and move to another CPU based on its mask after the
migrate_disable() section has been left.
Cc: stable-rt@vger.kernel.org
Signed-off-by: Mike Galbraith <efault@gmx.de>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
2019-04-08 23:49:20 +00:00
kernel/sched/core.c | 2 +-
2018-08-31 15:16:36 +00:00
1 file changed, 1 insertion(+), 1 deletion(-)
2019-04-08 23:49:20 +00:00
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
2020-08-28 04:53:35 +00:00
index f13cc0073bbc..297934719db9 100644
2018-08-31 15:16:36 +00:00
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
2019-04-30 12:45:19 +00:00
@@ -904,7 +904,7 @@ static inline bool is_cpu_allowed(struct task_struct *p, int cpu)
2018-08-31 15:16:36 +00:00
if (!cpumask_test_cpu(cpu, p->cpus_ptr))
return false;
- if (is_per_cpu_kthread(p))
+ if (is_per_cpu_kthread(p) || __migrate_disabled(p))
return cpu_online(cpu);
return cpu_active(cpu);
2020-01-03 23:36:11 +00:00
--
2020-06-22 13:14:16 +00:00
2.17.1
2020-01-03 23:36:11 +00:00