linux/debian/patches-rt/sched-Allow-pinned-user-tas...

34 lines
1.2 KiB
Diff
Raw Normal View History

2018-08-31 15:16:36 +00:00
From: Mike Galbraith <efault@gmx.de>
Date: Sun, 19 Aug 2018 08:28:35 +0200
Subject: [PATCH] sched: Allow pinned user tasks to be awakened to the CPU they
pinned
2019-02-27 18:51:46 +00:00
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.25-rt16.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>
---
kernel/sched/core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
2019-01-11 14:52:15 +00:00
@@ -902,7 +902,7 @@ static inline bool is_cpu_allowed(struct
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);