Messages in this thread | | | From | John Ogness <> | Subject | Re: [PATCH printk v4 17/27] printk: nbcon: Use nbcon consoles in console_flush_all() | Date | Thu, 18 Apr 2024 00:05:29 +0206 |
| |
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
| |