Re: [PATCH v6 19/21] timer: Implement the hierarchical pull model

From: Sebastian Siewior
Date: Tue May 16 2023 - 05:37:22 EST


On 2023-05-16 11:24:51 [+0200], Frederic Weisbecker wrote:
> > This looks okay. I wouldn't suggest to hold the timer_base::lock or
> > tmigr_cpu::lock longer than needed. Both can be acquired independently
> > cross CPU and have explicit locking order. So it is fine.
>
>
> LOCK(A)
> LOCK(B)
> UNLOCK(A)
> UNLOCK(B)
>
>
> Cross rhymes aren't pretty in locking. They don't make the review smooth
> but yeah it's not incorrect either. And since I don't have a better way to
> propose...

tmigr_cpu::lock is required longer than timer_base::lock. You can't
acquire tmigr_cpu::lock -> timer_base::lock due to lock ordering.

So you follow the lock order, acquire what needed, drop everything else
to lower lock contention for others.

> > > Thanks,
> > >
> > > Anna-Maria

Sebastian