lkml.org 
[lkml]   [2022]   [Nov]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: replay log: Re: [PATCH printk v4 38/39] printk: relieve console_lock of list synchronization duties
Date
On 2022-11-15, Petr Mladek <pmladek@suse.com> wrote:
>>> --- a/kernel/printk/printk.c
>>> +++ b/kernel/printk/printk.c
>>> @@ -3334,6 +3330,11 @@ void register_console(struct console *newcon)
>>> * boot console that is the furthest behind.
>>> */
>>> if (bootcon_registered && !keep_bootcon) {
>>> + /*
>>> + * Hold the console_lock to guarantee safe access to
>>> + * console->seq.
>>> + */
>>> + console_lock();
>>> for_each_console(con) {
>>> if ((con->flags & CON_BOOT) &&
>>> (con->flags & CON_ENABLED) &&
>>> @@ -3341,6 +3342,7 @@ void register_console(struct console *newcon)
>>> newcon->seq = con->seq;
>>> }
>>> }
>>> + console_unlock();
>
> So, without the above two hunks:
>
> Reviewed-by: Petr Mladek <pmladek@suse.com>

Note that we actually need those hunks to guarantee a consistent @seq
value. The console_lock is the only synchronization mechanism available
to read console->seq.

John

\
 
 \ /
  Last update: 2022-11-15 18:26    [W:0.084 / U:0.012 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site