diff options
author | Salvatore Bonaccorso <carnil@debian.org> | 2019-12-18 18:06:31 +0100 |
---|---|---|
committer | Salvatore Bonaccorso <carnil@debian.org> | 2019-12-18 22:50:21 +0100 |
commit | 102987a83771aa994821d4d982d06faa64c789e4 (patch) | |
tree | 3e5ab5206886ec297a1a97ce80f504d75468ed2f /debian/patches-rt/kernel-sched-move-stack-kprobe-clean-up-to-__put_tas.patch | |
parent | 479cb120ecb2b3f2c4d929a7b57860248d6f79bd (diff) | |
download | linux-debian-102987a83771aa994821d4d982d06faa64c789e4.tar.gz |
[rt] Update to 5.4.3-rt1 and re-enable
Adjust for context changes due to backport of
e66b39af00f4 ("workqueue: Fix pwq ref leak in rescuer_thread()") and
def98c84b6cd ("workqueue: Fix spurious sanity check failures in
destroy_workqueue()") in 5.4.4.
Diffstat (limited to 'debian/patches-rt/kernel-sched-move-stack-kprobe-clean-up-to-__put_tas.patch')
-rw-r--r-- | debian/patches-rt/kernel-sched-move-stack-kprobe-clean-up-to-__put_tas.patch | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/debian/patches-rt/kernel-sched-move-stack-kprobe-clean-up-to-__put_tas.patch b/debian/patches-rt/kernel-sched-move-stack-kprobe-clean-up-to-__put_tas.patch index ebf2e4db0..580b25b95 100644 --- a/debian/patches-rt/kernel-sched-move-stack-kprobe-clean-up-to-__put_tas.patch +++ b/debian/patches-rt/kernel-sched-move-stack-kprobe-clean-up-to-__put_tas.patch @@ -2,19 +2,21 @@ From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Mon, 21 Nov 2016 19:31:08 +0100 Subject: [PATCH] kernel/sched: move stack + kprobe clean up to __put_task_struct() -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.2/older/patches-5.2.17-rt9.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.4/older/patches-5.4.3-rt1.tar.xz There is no need to free the stack before the task struct (except for reasons mentioned in commit 68f24b08ee89 ("sched/core: Free the stack early if CONFIG_THREAD_INFO_IN_TASK")). This also comes handy on -RT because we can't free memory in preempt disabled region. +vfree_atomic() delays the memory cleanup to a worker. Since we move everything +to the RCU callback, we can also free it immediately. Cc: stable-rt@vger.kernel.org #for kprobe_flush_task() Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - kernel/fork.c | 10 ++++++++++ + kernel/fork.c | 12 +++++++++++- kernel/sched/core.c | 9 --------- - 2 files changed, 10 insertions(+), 9 deletions(-) + 2 files changed, 11 insertions(+), 10 deletions(-) --- a/kernel/fork.c +++ b/kernel/fork.c @@ -26,7 +28,16 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> #include <linux/vmacache.h> #include <linux/nsproxy.h> #include <linux/capability.h> -@@ -742,6 +743,15 @@ void __put_task_struct(struct task_struc +@@ -289,7 +290,7 @@ static inline void free_thread_stack(str + return; + } + +- vfree_atomic(tsk->stack); ++ vfree(tsk->stack); + return; + } + #endif +@@ -750,6 +751,15 @@ void __put_task_struct(struct task_struc WARN_ON(refcount_read(&tsk->usage)); WARN_ON(tsk == current); @@ -44,7 +55,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> security_task_free(tsk); --- a/kernel/sched/core.c +++ b/kernel/sched/core.c -@@ -2721,15 +2721,6 @@ static struct rq *finish_task_switch(str +@@ -3253,15 +3253,6 @@ static struct rq *finish_task_switch(str if (prev->sched_class->task_dead) prev->sched_class->task_dead(prev); @@ -57,6 +68,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> - /* Task is done with its stack. */ - put_task_stack(prev); - - put_task_struct(prev); + put_task_struct_rcu_user(prev); } |