sched: Move kprobes cleanup out of finish_task_switch()
authorThomas Gleixner <tglx@linutronix.de>
Tue, 28 Sep 2021 12:24:28 +0000 (14:24 +0200)
committerPeter Zijlstra <peterz@infradead.org>
Tue, 5 Oct 2021 13:52:14 +0000 (15:52 +0200)
commit670721c7bd2a6e16e40db29b2707a27bdecd6928
tree27ead0ffba4532ed1e500925b7d9b1783bd6687f
parent539fbb5be0da56ffa1434b4f56521a0522bd1d61
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
kernel/exit.c
kernel/kprobes.c
kernel/sched/core.c