diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2021-08-16 00:27:55 +0300 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2021-08-17 18:01:47 +0300 |
commit | 709e0b62869f625afd18edd79f190c38cb39dfb2 (patch) | |
tree | a494ff0755664c1436503aa1039264d837d2bf59 /kernel/locking/rtmutex.c | |
parent | 785159301bedea25fae9b20cae3d12377246e941 (diff) | |
download | linux-709e0b62869f625afd18edd79f190c38cb39dfb2.tar.xz |
locking/rtmutex: Switch to from cmpxchg_*() to try_cmpxchg_*()
Allows the compiler to generate better code depending on the architecture.
Suggested-by: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Link: https://lore.kernel.org/r/20210815211302.668958502@linutronix.de
Diffstat (limited to 'kernel/locking/rtmutex.c')
-rw-r--r-- | kernel/locking/rtmutex.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/kernel/locking/rtmutex.c b/kernel/locking/rtmutex.c index 5187added8bc..98f06c509f02 100644 --- a/kernel/locking/rtmutex.c +++ b/kernel/locking/rtmutex.c @@ -145,14 +145,14 @@ static __always_inline bool rt_mutex_cmpxchg_acquire(struct rt_mutex *lock, 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); } /* |