]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
exit: kill the pointless __exit_signal()->clear_tsk_thread_flag(TIF_SIGPENDING)
authorOleg Nesterov <oleg@redhat.com>
Thu, 6 Feb 2025 15:23:34 +0000 (16:23 +0100)
committerChristian Brauner <brauner@kernel.org>
Fri, 7 Feb 2025 10:20:57 +0000 (11:20 +0100)
It predates the git history and most probably it was never needed. It
doesn't really hurt, but it looks confusing because its purpose is not
clear at all.

release_task(p) is called when this task has already passed exit_notify()
so signal_pending(p) == T shouldn't make any difference.

And even _if_ there were a subtle reason to clear TIF_SIGPENDING after
exit_notify(), this clear_tsk_thread_flag() can't help anyway.  If the
exiting task is a group leader or if it is ptraced, release_task() will
be likely called when this task has already done its last schedule() from
do_task_dead().

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Link: https://lore.kernel.org/r/20250206152334.GB14620@redhat.com
Acked-by: Frederic Weisbecker <frederic@kernel.org>
Signed-off-by: Christian Brauner <brauner@kernel.org>
kernel/exit.c

index 2d7444da743dce2b48ae0c6de35dc10b7a67a8db..0acb94b17caae52ae3db76659e56ecaecff2f9ac 100644 (file)
@@ -204,7 +204,6 @@ static void __exit_signal(struct task_struct *tsk)
        spin_unlock(&sighand->siglock);
 
        __cleanup_sighand(sighand);
-       clear_tsk_thread_flag(tsk, TIF_SIGPENDING);
        if (group_dead)
                tty_kref_put(tty);
 }