aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/kprobes.c
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2021-09-28 14:24:28 +0200
committerPeter Zijlstra <peterz@infradead.org>2021-10-05 15:52:14 +0200
commit670721c7bd2a6e16e40db29b2707a27bdecd6928 (patch)
tree27ead0ffba4532ed1e500925b7d9b1783bd6687f /kernel/kprobes.c
parentsched: Disable TTWU_QUEUE on RT (diff)
downloadlinux-dev-670721c7bd2a6e16e40db29b2707a27bdecd6928.tar.xz
linux-dev-670721c7bd2a6e16e40db29b2707a27bdecd6928.zip
sched: Move kprobes cleanup out of finish_task_switch()
Doing cleanups in the tail of schedule() is a latency punishment for the incoming task. The point of invoking kprobes_task_flush() for a dead task is that the instances are returned and cannot leak when __schedule() is kprobed. Move it into the delayed cleanup. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Link: https://lkml.kernel.org/r/20210928122411.537994026@linutronix.de
Diffstat (limited to 'kernel/kprobes.c')
-rw-r--r--kernel/kprobes.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/kernel/kprobes.c b/kernel/kprobes.c
index 790a573bbe00..9a38e7581a5c 100644
--- a/kernel/kprobes.c
+++ b/kernel/kprobes.c
@@ -1250,10 +1250,10 @@ void kprobe_busy_end(void)
}
/*
- * This function is called from finish_task_switch when task tk becomes dead,
- * so that we can recycle any function-return probe instances associated
- * with this task. These left over instances represent probed functions
- * that have been called but will never return.
+ * This function is called from delayed_put_task_struct() when a task is
+ * dead and cleaned up to recycle any function-return probe instances
+ * associated with this task. These left over instances represent probed
+ * functions that have been called but will never return.
*/
void kprobe_flush_task(struct task_struct *tk)
{