[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87mt8pon3a.fsf@jogness.linutronix.de>
Date: Thu, 17 Nov 2022 12:14:09 +0106
From: John Ogness <john.ogness@...utronix.de>
To: Doug Anderson <dianders@...omium.org>
Cc: Petr Mladek <pmladek@...e.com>,
Sergey Senozhatsky <senozhatsky@...omium.org>,
Steven Rostedt <rostedt@...dmis.org>,
Thomas Gleixner <tglx@...utronix.de>,
linux-kernel@...r.kernel.org,
Jason Wessel <jason.wessel@...driver.com>,
Daniel Thompson <daniel.thompson@...aro.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Jiri Slaby <jirislaby@...nel.org>,
kgdb-bugreport@...ts.sourceforge.net, linux-serial@...r.kernel.org
Subject: Re: [PATCH printk v5 38/40] tty: serial: kgdboc: use
console_list_lock to trap exit
On 2022-11-16, Doug Anderson <dianders@...omium.org> wrote:
>> /*
>> - * Hold the console_lock to guarantee that no consoles are
>> + * Hold the console_list_lock to guarantee that no consoles are
>> * unregistered until the kgdboc_earlycon setup is complete.
>> * Trapping the exit() callback relies on exit() not being
>> * called until the trap is setup. This also allows safe
>> * traversal of the console list and race-free reading of @flags.
>> */
>> - console_lock();
>> + console_list_lock();
>> for_each_console(con) {
>> if (con->write && con->read &&
>> (con->flags & (CON_BOOT | CON_ENABLED)) &&
>
> Officially don't we need both the list lock and normal lock here since
> we're reaching into the consoles?
AFAICT the only synchronization we need here is iterating the console
list, reading con->flags of a registered console, and modifying
con->exit of a registered console. The console_list_lock provides
synchronization for all of these things. By the end of this series the
console_lock does not provide synchronization for any of these things.
Is there something else that requires synchronization here?
After this series the console_lock is still responsible for:
- serializing console->write() callbacks
- stopping console->write() callbacks
- stopping console->device() callbacks
- synchronizing console->seq
- synchronizing console->dropped
- synchronizing the global @console_suspended
- providing various unclear protection for vt consoles
- some bizarre misuses in bcache
The scope may be larger than the above list. The investigation is still
ongoing.
John
Powered by blists - more mailing lists