Skip to content

RFC kernel: decouple TASK_WORK TWA_SIGNAL handling from signals

Jens Axboe io-uring lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest3 patches 11 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3kernel: add task_sigpending() helperinclude/linux/sched/signal.h kernel/events/uprobes.c kernel/ptrace.c +1 more+17 -120 replies
2/3kernel: decouple TASK_WORK TWA_SIGNAL handling from signalsarch/x86/include/asm/thread_info.h arch/x86/kernel/signal.c include/linux/entry-common.h +2 more+65 -220 replies
3/3task_work: use TIF_TASKWORK if availablekernel/task_work.c+36 -1211 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCHSET RFC 0/3] kernel: decouple TASK_WORK TWA_SIGNAL handling from signals

Hi,

I split this up into 3 pieces instead of the messy single patch, hope this helps with review.

Patch 1 adds task_sigpending(), which tests TIF_SIGPENDING. Core use cases that need to check for an actual signal pending are switched to using task_sigpending() instead of signal_pending(). This should fix Oleg's concern on signal_pending() == true, but no signals pending, for actual signal delivery.

Patch 2 adds x86 and generic entry code support for TIF_TASKWORK.

Patch 3 adds task_work support for TIF_TASKWORK, if the arch supports it.

There's no need for any io_uring specific changes, so I've dropped those. If TIF_TASKWORK is used, then JOBCTL_TASK_WORK will never be true and hence we won't enter that case. If TIF_TASKWORK isn't available, then we still need that code.

I've run this through my usual liburing test, and it passes. I also ran it through all the ltp signal testing, and no changes from mainline in terms of all tests passing.

 arch/x86/include/asm/thread_info.h |  2 ++
 arch/x86/kernel/signal.c           | 32 +++++++++++---------
 include/linux/entry-common.h       | 20 +++++++++++--
 include/linux/sched/signal.h       | 32 ++++++++++++++++----
 kernel/entry/common.c              | 14 +++++++--
 kernel/events/uprobes.c            |  2 +-
 kernel/ptrace.c                    |  2 +-
 kernel/signal.c                    | 12 ++++----
 kernel/task_work.c                 | 48 ++++++++++++++++++++++--------
 9 files changed, 118 insertions(+), 46 deletions(-)

Changes can also be viewed/pulled from this branch:

git://git.kernel.dk/linux-block tif-task_work

https://git.kernel.dk/cgit/linux-block/log/?h=tif-task_work

Signature · 1 line
Jens Axboe