lkml.org 
[lkml]   [2024]   [Apr]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH printk v4 17/27] printk: nbcon: Use nbcon consoles in console_flush_all()
Date
On 2024-04-11, Petr Mladek <pmladek@suse.com> wrote:
> console_flush_all() is called from console_unlock().
> It might be called in atomic context. But the current
> owner might be theoretically scheduled out.

Nice catch. This problem was introduced in this series after you pointed
out that return value of nbcon_legacy_emit_next_record() did not match
the semantics of console_emit_next_record().

> I see 3 possible solutions:
>
> 1. Enforce that nbcon context can be acquired only with preemtion
> disabled.

Not acceptable.

> 2. Enforce that nbcon context can be acquired only with
> interrupts. It would prevent deadlock when some future
> code interrupt flush in NBCON_PRIO_EMERGENCY context.
> And then a potential nested console_flush_all() won't be
> able to takeover the interrupted NBCON_PRIO_CONTEXT
> and there will be no progress.

Not acceptable.

> 3. console_flush_all() should ignore nbcon console when
> it is not able to get the context, aka no progress.

This was the previous implementation, but as you point out, it is an
issue that console_flush_all() is no longer reliable.

I will continue this topic by responding to your follow-up message.

John

\
 
 \ /
  Last update: 2024-05-27 16:43    [W:0.106 / U:0.332 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site