Not restarting for due to signals.
Get series with b4
b4 am [email protected]Versions newest first
- v5 Latest6 patches 3 repliesIn review
Patches in v5 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/6 | fork: Move and describe why the code examines PIDNS_ADDINGkernel/ | +7 | 0 replies | |
| 2/6 | fork: Unconditionally exit if a fatal signal is pendingkernel/ | +6 | 0 replies | |
| 3/6 | signal: Add calculate_sigpending()include/ kernel/ kernel/ | +14 | 0 replies | |
| 4/6 | fork: Skip setting TIF_SIGPENDING in ptrace_init_taskinclude/ | +0 | 0 replies | |
| 5/6 | fork: Have new threads join on-going signal group stopsinclude/ kernel/ kernel/ | +31 | 0 replies | |
| 6/6 | signal: Don't restart fork when signals come in.include/ init/ kernel/ +1 more | +52 | 3 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v5 yet.
Cover letter [PATCH v5 0/6] Not restarting for due to signals.
This builds on patches 1-15 of my previous patch posting. As those are non-controversial I am not posting them again.
I took longer than I had hoped to get this set together because a kernel testing robot noticed some random corruption with the way I had been adding to the list. I finally tracked it down to failing to remove the sigset from the list during fork_idle. So I have made that logic simpler and use hlist_del_init which will only remove an item from a list if it was placed on the list in the first place.
I took Oleg's suggesting and moved calculate_sigpending into schedule_tail where recalc_sigpending an be used directly. Then in calculate_sigpending I just unconditionally set TIF_SIGPENDING and allow recalc_sigpending to clear TIF_SIGPENDING if we don't need it.
I also now handle the stop/continue signal magic where we only let one of stop signals and SIGCONT be pending at a time. Looking at it from first principles dropping one of SIGTSTP SIGTTIN SIGTTOU or SIGCONT before calling it's handler feels wrong. I checked and it is our historical behavior, so I won't even thinking of introducing different behavior at this point.
Eric W. Biederman (6):
fork: Move and describe why the code examines PIDNS_ADDING
fork: Unconditionally exit if a fatal signal is pending
signal: Add calculate_sigpending()
fork: Skip setting TIF_SIGPENDING in ptrace_init_task
fork: Have new threads join on-going signal group stops
signal: Don't restart fork when signals come in.
include/linux/ptrace.h | 2 -- include/linux/sched/signal.h | 11 ++++++++++ init/init_task.c | 1 + kernel/fork.c | 49 ++++++++++++++++++++++++++++++-------------- kernel/sched/core.c | 2 ++ kernel/signal.c | 43 ++++++++++++++++++++++++++++++++++++++ 6 files changed, 91 insertions(+), 17 deletions(-)
Eric