Re: [PATCH printk v5 09/17] printk: nbcon: Rely on kthreads for normal operation
From: John Ogness
Date: Tue Sep 03 2024 - 07:51:10 EST
On 2024-09-03, Petr Mladek <pmladek@xxxxxxxx> wrote:
>> @@ -3071,12 +3080,21 @@ static bool console_flush_all(bool do_cond_resched, u64 *next_seq, bool *handove
>> do {
>> any_progress = false;
>>
>> + printk_get_console_flush_type(&ft);
>> +
>> cookie = console_srcu_read_lock();
>> for_each_console_srcu(con) {
>> short flags = console_srcu_read_flags(con);
>> u64 printk_seq;
>> bool progress;
>>
>> + /*
>> + * console_flush_all() is only for legacy consoles when
>> + * the nbcon consoles have their printer threads.
>> + */
>> + if ((flags & CON_NBCON) && ft.nbcon_offload)
>> + continue;
>
> I mean that we really
> should handle nbcon consoles in the legacy loop only when there
> is a boot console (both ft.nbcon_* == false).
Agreed. I will change it to:
/*
* console_flush_all() is only responsible for nbcon
* consoles when the nbcon consoles cannot print via
* their atomic or threaded flushing.
*/
if ((flags & CON_NBCON) && (ft.nbcon_atomic || ft.nbcon_offload))
continue;
Also note that patch 15/17 ("printk: Implement legacy printer kthread
for PREEMPT_RT") has the same check in legacy_kthread_should_wakeup(),
which I will also update.
John