Re: [PATCH printk v4 11/39] console: introduce wrappers to read/write console flags

From: Petr Mladek
Date: Tue Nov 15 2022 - 07:27:06 EST


On Mon 2022-11-14 17:35:04, John Ogness wrote:
> After switching to SRCU for console list iteration, some readers
> will begin readings console->flags as a data race. Locklessly
> reading console->flags provides a consistent value because there
> is at most one CPU modifying console->flags and that CPU is
> using only read-modify-write operations.
>
> Introduce a wrapper for SRCU iterators to read console flags.
> Introduce a matching wrapper to write to flags of registered
> consoles. Writing to flags of registered consoles is synchronized
> by the console_list_lock.
>
> Signed-off-by: John Ogness <john.ogness@xxxxxxxxxxxxx>

Reviewed-by: Petr Mladek <pmladek@xxxxxxxx>

Best Regards,
Petr