Re: [RESEND x3][PATCH v12 2/7] locking/mutex: Make mutex::wait_lock irq safe
From: John Stultz
Date: Thu Oct 10 2024 - 22:26:52 EST
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."
?
Thanks for the feedback!
-john