lkml.org 
[lkml]   [2024]   [May]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH printk v5 19/30] printk: nbcon: Provide function to flush using write_atomic()
Date
On 2024-05-20, Petr Mladek <pmladek@suse.com> wrote:
> What about reshufling the code a bit?
>
> <proposal>
[...]
> </proposal>

Your proposal is fine and is easier to follow. Thanks.

>> + /*
>> + * This context must flush any new records added while the console
>> + * was locked. The console_srcu_read_lock must be taken to ensure
>> + * the console is usable throughout flushing.
>> + */
>> + cookie = console_srcu_read_lock();
>
> In principle, this should not be needed because the console is
> added/removed under con->device_lock() in
> register_console()/unregister_console(). And this function
> nbcon_driver_release() should be called under the same lock.

I added a comment here to make it clear why it is needed. It is about
making sure the console is _usable_ during the flushing, i.e. it
prevents console_suspend() and console_stop() from exiting while the
flush is in progress.

I will leave this as is for v6.

John

\
 
 \ /
  Last update: 2024-05-21 21:07    [W:0.066 / U:0.488 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site