kernel: add task_sigpending() helper
authorJens Axboe <axboe@kernel.dk>
Thu, 1 Oct 2020 17:29:38 +0000 (11:29 -0600)
committerJens Axboe <axboe@kernel.dk>
Mon, 26 Oct 2020 14:45:32 +0000 (08:45 -0600)
commitc0947f6b6ed220acd67a39795d74267c1bc21355
tree86df45c11715534eb1d4b3e7f8cfe62e6a2cdc44
parent3650b228f83adda7e5ee532e2b90429c03f7b9ec
kernel: add task_sigpending() helper

This is in preparation for maintaining signal_pending() as the decider
of whether or not a schedule() loop should be broken, or continue
sleeping. This is different than the core signal use cases, where we
really want to know if an actual signal is pending or not.
task_sigpending() returns non-zero if TIF_SIGPENDING is set.

Only core kernel use cases should care about the distinction between
the two, make sure those use the task_sigpending() helper.

Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
include/linux/sched/signal.h
kernel/events/uprobes.c
kernel/signal.c