task_work: cleanup notification modes
authorJens Axboe <axboe@kernel.dk>
Fri, 16 Oct 2020 15:02:26 +0000 (09:02 -0600)
committerJens Axboe <axboe@kernel.dk>
Sat, 17 Oct 2020 21:05:30 +0000 (15:05 -0600)
commit91989c707884ecc7cd537281ab1a4b8fb7219da3
tree6233f38efc87d14b003fa217460378a4338b5a28
parent3c532798ec96b6c2d77706f04ed1d8b566a805df
task_work: cleanup notification modes

A previous commit changed the notification mode from true/false to an
int, allowing notify-no, notify-yes, or signal-notify. This was
backwards compatible in the sense that any existing true/false user
would translate to either 0 (on notification sent) or 1, the latter
which mapped to TWA_RESUME. TWA_SIGNAL was assigned a value of 2.

Clean this up properly, and define a proper enum for the notification
mode. Now we have:

- TWA_NONE. This is 0, same as before the original change, meaning no
  notification requested.
- TWA_RESUME. This is 1, same as before the original change, meaning
  that we use TIF_NOTIFY_RESUME.
- TWA_SIGNAL. This uses TIF_SIGPENDING/JOBCTL_TASK_WORK for the
  notification.

Clean up all the callers, switching their 0/1/false/true to using the
appropriate TWA_* mode for notifications.

Fixes: e91b48162332 ("task_work: teach task_work_add() to do signal_wake_up()")
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
14 files changed:
arch/x86/kernel/cpu/mce/core.c
arch/x86/kernel/cpu/resctrl/rdtgroup.c
drivers/acpi/apei/ghes.c
drivers/android/binder.c
fs/file_table.c
fs/io_uring.c
fs/namespace.c
include/linux/task_work.h
kernel/events/uprobes.c
kernel/irq/manage.c
kernel/sched/fair.c
kernel/task_work.c
security/keys/keyctl.c
security/yama/yama_lsm.c