2023-09-26 09:10:14

by Ming Qian

[permalink] [raw]
Subject: RE: [EXT] Re: [PATCH] wait: don't wake up freezable wait by freezing fake signal

>From: Peter Zijlstra <[email protected]>
>Sent: 2023??9??25?? 18:08
>To: Ming Qian <[email protected]>
>Cc: [email protected]; [email protected]; [email protected];
>[email protected]; [email protected]; [email protected];
>[email protected]; [email protected]; [email protected]; Eagle Zhou
><[email protected]>; Tao Jiang <[email protected]>; dl-linux-imx
><[email protected]>; [email protected]; linux-arm-
>[email protected]
>Subject: [EXT] Re: [PATCH] wait: don't wake up freezable wait by freezing fake
>signal
>
>Caution: This is an external email. Please take care when clicking links or
>opening attachments. When in doubt, report the message using the 'Report
>this email' button
>
>
>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?

Hi Peter,
We have a driver that needs to interact with the daemon on nxp IMX8MP-EVK, Initially we use wait_event_interruptible to wait for a response from the daemon, but in our suspend test, sometimes we met failure which was caused by the waiting interrupted.
Then we use wait_event_freezable instead, but the problem remains. The above retry code should fix the problem, but we think it may be a common issue.
So we try to improve the wait_event_freezable, then we can pass our suspend test without any rety.

Ming