Re: [PATCH v2] printk_legacy_map: use LD_WAIT_CONFIG instead of LD_WAIT_SLEEP
From: Oleg Nesterov
Date: Fri Oct 24 2025 - 11:17:30 EST
So it seems that you guys finally have a consensus on this patch ;)
Should I send v3 or will you do it? I don't care about the "From:" tag.
If you want me to do it, let me ask:
On 10/24, Petr Mladek wrote:
>
> On Fri 2025-10-24 12:38:08, Sebastian Andrzej Siewior wrote:
> > The legacy console always acquires a spinlock_t from its printing
> > callback. This violates lock nesting if the caller acquired an always
> > spinning lock (raw_spinlock_t) while invoking printk(). This is not a
> > problem on PREEMPT_RT because legacy consoles print always from a
> > dedicated thread and never from within printk(). Therefore we tell
> > lockdep that a sleeping spin lock (spinlock_t) is valid here.
>
> Looks good to me.
Same here. Should I replace the whole comment block above
DEFINE_WAIT_OVERRIDE_MAP(printk_legacy_map) with the text above?
> > printk_legacy_map is used to hide lock nesting violations caused by
> > legacy drivers and is using the wrong override type. LD_WAIT_SLEEP is
> > for always sleeping lock types such as mutex_t. LD_WAIT_CONFIG is for
> > lock type which are sleeping while spinning on PREEMPT_RT such as
> > spinlock_t.
>
> Looks goot to me.
Same here. Should I add anything else into the changelog?
> JFYI, I do not mind which version is used.
Same here ;)
Oleg.