[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210811121414.795305075@linutronix.de>
Date: Wed, 11 Aug 2021 14:22:44 +0200 (CEST)
From: Thomas Gleixner <tglx@...utronix.de>
To: LKML <linux-kernel@...r.kernel.org>
Cc: Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...nel.org>,
Juri Lelli <juri.lelli@...hat.com>,
Steven Rostedt <rostedt@...dmis.org>,
Daniel Bristot de Oliveira <bristot@...hat.com>,
Will Deacon <will@...nel.org>,
Waiman Long <longman@...hat.com>,
Boqun Feng <boqun.feng@...il.com>,
Sebastian Andrzej Siewior <bigeasy@...utronix.de>,
Davidlohr Bueso <dave@...olabs.net>,
Mike Galbraith <efault@....de>
Subject: [patch V4 11/68] rtmutex: Switch to try_cmpxchg()
From: Thomas Gleixner <tglx@...utronix.de>
Allows the compiler to generate better code depending on the architecture.
Suggested-by: Peter Zijlstra <peterz@...radead.org>
Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
---
kernel/locking/rtmutex.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/kernel/locking/rtmutex.c
+++ b/kernel/locking/rtmutex.c
@@ -145,14 +145,14 @@ static __always_inline bool rt_mutex_cmp
struct task_struct *old,
struct task_struct *new)
{
- return cmpxchg_acquire(&lock->owner, old, new) == old;
+ return try_cmpxchg_acquire(&lock->owner, &old, new);
}
static __always_inline bool rt_mutex_cmpxchg_release(struct rt_mutex *lock,
struct task_struct *old,
struct task_struct *new)
{
- return cmpxchg_release(&lock->owner, old, new) == old;
+ return try_cmpxchg_release(&lock->owner, &old, new);
}
/*
Powered by blists - more mailing lists