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

Ming Qian ming.qian at nxp.com
Mon Sep 25 19:43:07 PDT 2023


>From: Peter Zijlstra <peterz at infradead.org>
>Sent: 2023年9月25日 18:08
>To: Ming Qian <ming.qian at nxp.com>
>Cc: mingo at redhat.com; juri.lelli at redhat.com; vincent.guittot at linaro.org;
>dietmar.eggemann at arm.com; rostedt at goodmis.org; bsegall at google.com;
>mgorman at suse.de; bristot at redhat.com; vschneid at redhat.com; Eagle Zhou
><eagle.zhou at nxp.com>; Tao Jiang <tao.jiang_2 at nxp.com>; dl-linux-imx
><linux-imx at nxp.com>; linux-kernel at vger.kernel.org; linux-arm-
>kernel at lists.infradead.org
>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


More information about the linux-arm-kernel mailing list