Re: [PATCH] wait: don't wake up freezable wait by freezing fake signal

From: Peter Zijlstra
Date: Mon Sep 25 2023 - 06:09:01 EST


On Tue, Aug 22, 2023 at 03:45:47PM +0800, Ming Qian wrote:
> kernel may try to wake up task with fake signal when freezing task,
> if the task is waiting event using wait_event_freezable,
> it's better to freeze the wait, instead of breaking it.
>
> otherwise the caller may need to retry the wait,
> maybe like below code:
>
> if (rc == -ERESTARTSYS && freezing(current)) {
> clear_thread_flag(TIF_SIGPENDING);
> goto again;
> }

I'm not sure I get it -- is there an actual problem, or are you trying
to optimize something?