diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 10:06:00 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 10:06:00 +0000 |
commit | b15a952c52a6825376d3e7f6c1bf5c886c6d8b74 (patch) | |
tree | 1500f2f8f276908a36d8126cb632c0d6b1276764 /debian/patches-rt/0291-sched-Collate-affine_move_task-stoppers.patch | |
parent | Adding upstream version 5.10.209. (diff) | |
download | linux-b15a952c52a6825376d3e7f6c1bf5c886c6d8b74.tar.xz linux-b15a952c52a6825376d3e7f6c1bf5c886c6d8b74.zip |
Adding debian version 5.10.209-2.debian/5.10.209-2
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'debian/patches-rt/0291-sched-Collate-affine_move_task-stoppers.patch')
-rw-r--r-- | debian/patches-rt/0291-sched-Collate-affine_move_task-stoppers.patch | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/debian/patches-rt/0291-sched-Collate-affine_move_task-stoppers.patch b/debian/patches-rt/0291-sched-Collate-affine_move_task-stoppers.patch new file mode 100644 index 000000000..b73fb91be --- /dev/null +++ b/debian/patches-rt/0291-sched-Collate-affine_move_task-stoppers.patch @@ -0,0 +1,69 @@ +From e62b758a0149648256ed0fa194d9e107e294d8aa Mon Sep 17 00:00:00 2001 +From: Peter Zijlstra <peterz@infradead.org> +Date: Tue, 8 Jun 2021 00:37:32 -0400 +Subject: [PATCH 291/323] sched: Collate affine_move_task() stoppers +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.204-rt100.tar.xz + +commit 58b1a45086b5f80f2b2842aa7ed0da51a64a302b upstream. + +The SCA_MIGRATE_ENABLE and task_running() cases are almost identical, +collapse them to avoid further duplication. + +Fixes: 6d337eab041d ("sched: Fix migrate_disable() vs set_cpus_allowed_ptr()") +Cc: stable@kernel.org +Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> +Signed-off-by: Ingo Molnar <mingo@kernel.org> +Reviewed-by: Valentin Schneider <valentin.schneider@arm.com> +Link: https://lkml.kernel.org/r/20210224131355.500108964@infradead.org +Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> +Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org> +--- + kernel/sched/core.c | 23 ++++++++--------------- + 1 file changed, 8 insertions(+), 15 deletions(-) + +diff --git a/kernel/sched/core.c b/kernel/sched/core.c +index 31fa925852e5..3130289baf79 100644 +--- a/kernel/sched/core.c ++++ b/kernel/sched/core.c +@@ -2291,30 +2291,23 @@ static int affine_move_task(struct rq *rq, struct task_struct *p, struct rq_flag + return -EINVAL; + } + +- if (flags & SCA_MIGRATE_ENABLE) { +- +- refcount_inc(&pending->refs); /* pending->{arg,stop_work} */ +- p->migration_flags &= ~MDF_PUSH; +- task_rq_unlock(rq, p, rf); +- +- stop_one_cpu_nowait(cpu_of(rq), migration_cpu_stop, +- &pending->arg, &pending->stop_work); +- +- return 0; +- } +- + if (task_running(rq, p) || p->state == TASK_WAKING) { + /* +- * Lessen races (and headaches) by delegating +- * is_migration_disabled(p) checks to the stopper, which will +- * run on the same CPU as said p. ++ * MIGRATE_ENABLE gets here because 'p == current', but for ++ * anything else we cannot do is_migration_disabled(), punt ++ * and have the stopper function handle it all race-free. + */ ++ + refcount_inc(&pending->refs); /* pending->{arg,stop_work} */ ++ if (flags & SCA_MIGRATE_ENABLE) ++ p->migration_flags &= ~MDF_PUSH; + task_rq_unlock(rq, p, rf); + + stop_one_cpu_nowait(cpu_of(rq), migration_cpu_stop, + &pending->arg, &pending->stop_work); + ++ if (flags & SCA_MIGRATE_ENABLE) ++ return 0; + } else { + + if (!is_migration_disabled(p)) { +-- +2.43.0 + |