[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20241007153554.GB14587@noisy.programming.kicks-ass.net>
Date: Mon, 7 Oct 2024 17:35:54 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Waiman Long <longman@...hat.com>
Cc: Ingo Molnar <mingo@...hat.com>, Will Deacon <will@...nel.org>,
Boqun Feng <boqun.feng@...il.com>, linux-kernel@...r.kernel.org,
Thomas Gleixner <tglx@...utronix.de>,
Luis Goncalves <lgoncalv@...hat.com>, Chunyu Hu <chuhu@...hat.com>
Subject: Re: [PATCH v3] locking/rtmutex: Always use trylock in
rt_mutex_trylock()
On Mon, Oct 07, 2024 at 11:29:10AM -0400, Waiman Long wrote:
> diff --git a/kernel/locking/rtmutex.c b/kernel/locking/rtmutex.c
> index ebebd0eec7f6..a32bc2bb5d5e 100644
> --- a/kernel/locking/rtmutex.c
> +++ b/kernel/locking/rtmutex.c
> @@ -1381,10 +1381,13 @@ static int __sched rt_mutex_slowtrylock(struct rt_mutex_base *lock)
> return 0;
>
> /*
> - * The mutex has currently no owner. Lock the wait lock and try to
> - * acquire the lock. We use irqsave here to support early boot calls.
> + * The mutex has currently no owner. Try to lock the wait lock first.
> + * If successful, try to acquire the lock. We use irqsave here to
> + * support early boot calls. Trylock is used all the way to avoid
> + * circular lock dependency.
> */
> - raw_spin_lock_irqsave(&lock->wait_lock, flags);
> + if (!raw_spin_trylock_irqsave(&lock->wait_lock, flags))
> + return 0;
>
NACKED!!!!
Powered by blists - more mailing lists