Re: Regression in next with use printk_safe buffers in printk

From: Peter Zijlstra
Date: Tue Feb 14 2017 - 11:18:36 EST


On Wed, Feb 15, 2017 at 01:01:40AM +0900, Sergey Senozhatsky wrote:
>
> but I'm a bit confused by rt_b->rt_runtime_lock in this unsafe lock
> scenario (so it's not ABBA, but ABAD)
>
> > lock(hrtimer_bases.lock);
> > lock(&rt_b->rt_runtime_lock);
> > lock(hrtimer_bases.lock);
> > lock(tk_core);
> >
> >
> > Chain exists of:
> >
> > tk_core --> &rt_b->rt_runtime_lock --> hrtimer_bases.lock
>
>
> I'm lacking some knowledge here, sorry. where does the tk_core --> &rt_b->rt_runtime_lock
> come from?

rt_b->rt_runtime_lock is one of the scheduler locks, since we do
printk() under tk_core, which does semaphore muck, which then includes
the entire scheduler chain of locks.