Re: [PATCH v2] locking/semaphore: Use wake_q to wake up processes outside lock critical section

From: Waiman Long
Date: Fri Sep 22 2023 - 20:31:11 EST



On 9/22/23 15:47, Peter Zijlstra wrote:
On Fri, Sep 22, 2023 at 02:45:04PM -0400, Waiman Long wrote:

I believe early_printk should only be used in the non-SMP boot process. The
use of printk() is frequently used for debugging purpose and the insertion
of printk at some lock critical section can cause the lockdep splat to come
out obscuring the debugging process.
By default early_printk is disabled somewhere early, but it has a keep
argument to keep it around.

Anyway, printk() as it exists today is wholly unsuited for debugging.
There are too many contexts where it will flat out not work. When you
use early_print with keep then you can use early_printk() instead of
printk() to debug.

Also, see the patches I pointed John at. Perf would not be what it is
without those patches.

Serial lines and early printk are not optional. That is, I flat out
refuse to develop on machines without them.

Thanks for the debugging tip.

BTW, it is not just printk() that can be problematic in some contexts. I believe the various WARN*() calls cause the same kind of lockdep problem even though these WARN() calls shouldn't be triggered that often

Cheers,
Longman