Re: [PATCH 2/2] KVM: VMX: Use separate subclasses for PI wakeup lock to squash false positive
From: Sean Christopherson
Date: Wed Apr 02 2025 - 16:06:40 EST
On Wed, Apr 02, 2025, Yan Zhao wrote:
> On Tue, Apr 01, 2025 at 08:47:27AM -0700, Sean Christopherson wrote:
> > I.e. lockdep sees AB+BC ordering for schedule out, and CA ordering for
> > wakeup, and complains about the A=>C versus C=>A inversion. In practice,
> > deadlock can't occur between schedule out and the wakeup handler as they
> > are mutually exclusive. The entirely of the schedule out code that runs
> > with the problematic scheduler locks held, does so with IRQs disabled,
> > i.e. can't run concurrently with the wakeup handler.
> >
> > Use a subclass instead disabling lockdep entirely, and tell lockdep that
> Paolo initially recommended utilizing the subclass.
> Do you think it's good to add his suggested-by tag?
Sure.
> BTW: is it necessary to state the subclass assignment explicitly in the
> patch msg? e.g.,
>
> wakeup handler: subclass 0
> sched_out: subclass 1
> sched_in: subclasses 0 and 1
Yeah, explicitly stating the effectively rules would be helpful. If those are
the only issues, I'll just fixup the changelog when applying.