Re: [RESEND x3][PATCH v12 2/7] locking/mutex: Make mutex::wait_lock irq safe
From: Steven Rostedt
Date: Thu Oct 10 2024 - 22:31:10 EST
On Thu, 10 Oct 2024 19:26:24 -0700
John Stultz <jstultz@xxxxxxxxxx> wrote:
> On Thu, Oct 10, 2024 at 7:00 AM Steven Rostedt <rostedt@xxxxxxxxxxx> wrote:
> > On Wed, 9 Oct 2024 16:53:35 -0700
> > John Stultz <jstultz@xxxxxxxxxx> wrote:
> >
> > > From: Juri Lelli <juri.lelli@xxxxxxxxxx>
> > >
> > > mutex::wait_lock might be nested under rq->lock.
> > >
> > > Make it irq safe then.
> >
> > Can you expand on this please?
> >
> > If the mutex:wait_lock might be taken under an rq->lock, doesn't that mean
> > a mutex was taken under rq->lock? Or is it something internal?
> >
> > This change log needs to be more explicit.
>
> Sure! Would the following work for you?
>
> "With the proxy-execution series, we traverse the task->mutex->task
> blocked_on/owner chain in the scheduler core. We do this while holding
> the rq::lock to keep the structures in place while taking and
> releasing the alternating lock types.
>
> Since the mutex::wait_lock is one of the locks we will take in this
> way under the rq::lock in the scheduler core, we need to make sure
> that its usage elsewhere is irq safe."
>
> ?
Yes, that explains things much better. ;-)
Thanks!
-- Steve