Re: [BUG] Threaded printk breaks early debugging

From: Sergey Senozhatsky
Date: Sat Jun 11 2022 - 23:13:56 EST


On (22/06/10 17:11), John Ogness wrote:
> It would be trivial to provide a boot parameter for this behavior, but I
> think we first need to see a real problem and also see if we can fix
> that problem.

John, Petr, a quick question

Should a situation when we have only one online CPU be enough of a reason
to do direct printing? Otherwise we might not have CPUs to wakeup khtread on,
e.g. when CPU that printk is in atomic section for too long.

---

@@ -480,6 +480,9 @@ static inline bool allow_direct_printing(void)
if (!printk_kthreads_available)
return true;

+ if (num_online_cpus() == 1)
+ return true;
+
/*
* Prefer direct printing when the system is in a problematic state.
* The context that sets this state will always see the updated value.