[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Yl/9iDqRL3zKBoSJ@alley>
Date: Wed, 20 Apr 2022 14:34:50 +0200
From: Petr Mladek <pmladek@...e.com>
To: John Ogness <john.ogness@...utronix.de>
Cc: Sergey Senozhatsky <senozhatsky@...omium.org>,
Steven Rostedt <rostedt@...dmis.org>,
Thomas Gleixner <tglx@...utronix.de>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH printk v3 03/15] printk: add missing memory barrier to
wake_up_klogd()
On Wed 2022-04-20 01:52:25, John Ogness wrote:
> It is important that any new records are visible to preparing
> waiters before the waker checks if the wait queue is empty.
> Otherwise it is possible that:
>
> - there are new records available
> - the waker sees an empty wait queue and does not wake
> - the preparing waiter sees no new records and begins to wait
>
> This is exactly the problem that the function description of
> waitqueue_active() warns about.
>
> Use wq_has_sleeper() instead of waitqueue_active() because it
> includes the necessary full memory barrier.
>
> Signed-off-by: John Ogness <john.ogness@...utronix.de>
Great catch! Looks good to me.
Reviewed-by: Petr Mladek <pmladek@...e.com>
Best Regards,
Petr
Powered by blists - more mailing lists