mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Waiman Long <longman@redhat.com>
Cc: Ingo Molnar <mingo@redhat.com>, Will Deacon <will@kernel.org>,
	Boqun Feng <boqun.feng@gmail.com>,
	linux-kernel@vger.kernel.org,
	Thomas Gleixner <tglx@linutronix.de>,
	Luis Goncalves <lgoncalv@redhat.com>,
	Chunyu Hu <chuhu@redhat.com>
Subject: Re: [PATCH v3] locking/rtmutex: Always use trylock in rt_mutex_trylock()
Date: Mon, 7 Oct 2024 17:35:54 +0200	[thread overview]
Message-ID: <20241007153554.GB14587@noisy.programming.kicks-ass.net> (raw)
In-Reply-To: <20241007152910.29457-1-longman@redhat.com>

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!!!!

      reply	other threads:[~2024-10-07 15:35 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-07 15:29 Waiman Long
2024-10-07 15:35 ` Peter Zijlstra [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241007153554.GB14587@noisy.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=boqun.feng@gmail.com \
    --cc=chuhu@redhat.com \
    --cc=lgoncalv@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=longman@redhat.com \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=will@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®