[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <64B85AC0-CEB5-4F11-8B83-3C2A2CD056FB@microgate.com>
Date: Wed, 2 Jan 2019 12:55:39 -0800
From: Paul Fulghum <paulkf@...rogate.com>
To: Tetsuo Handa <penguin-kernel@...ove.SAKURA.ne.jp>
Cc: Arnd Bergmann <arnd@...db.de>, Alan Cox <alan@...rguk.ukuu.org.uk>,
gregkh@...uxfoundation.org, jslaby@...e.com,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] tty/n_hdlc: fix sleep in !TASK_RUNNING state warning
> On Jan 2, 2019, at 7:04 AM, Tetsuo Handa <penguin-kernel@...ove.SAKURA.ne.jp> wrote:
>
> On 2019/01/01 12:11, Paul Fulghum wrote:
>> NAK to this patch. It causes lost wakeups in both read and write paths.
>>
>> The write path does not need changing.
>>
>> The read path can be fixed by setting current to TASK_RUNNING at the top of the if (rbuf) block
>> so the warning is not triggered by copy_to_user(). If this block runs the condition is satisfied
>> and it breaks out of the polling loop where it is already being set to TASK_RUNNING and removed
>> from the wait queue. This particular path just needs to account for the copy_to_user which occurs
>> before breaking out.
>>
>> I’ll make a patch to do this when I have the ability to test it in a day or two.
>>
>
> OK. Then, any chance it is rewritten using wait_event_interruptible() in order to reduce lines?
> ( wait_event_interruptible() automatically calls might_sleep(), but is it acceptable for you? )
>
This looks good to me. I applied it and tested blocking (sleep/no sleep) and non-blocking (success/EAGAIN) paths for both read and write.
Powered by blists - more mailing lists