Message ID | 89ed3a52933370deaaf61a0a620a6ac91f1e754d.1720634146.git.asml.silence@gmail.com (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | fix task_work interation with freezing | expand |
I have already acked this patch, so I am sorry for the noise, but On 07/10, Pavel Begunkov wrote: > > Run task_works in the freezer path. Keep the patch small and simple > so it can be easily back ported, Agreed. I tried to argue with v1 which added the additional task_work_run() into get_signal(), but I failed to suggest a "better" change which doesn't uglify/complicate get_signal/backporting. Oleg.
diff --git a/kernel/signal.c b/kernel/signal.c index 1f9dd41c04be..60c737e423a1 100644 --- a/kernel/signal.c +++ b/kernel/signal.c @@ -2600,6 +2600,14 @@ static void do_freezer_trap(void) spin_unlock_irq(¤t->sighand->siglock); cgroup_enter_frozen(); schedule(); + + /* + * We could've been woken by task_work, run it to clear + * TIF_NOTIFY_SIGNAL. The caller will retry if necessary. + */ + clear_notify_signal(); + if (unlikely(task_work_pending(current))) + task_work_run(); } static int ptrace_signal(int signr, kernel_siginfo_t *info, enum pid_type type)