Commit 709e0b62 authored by Thomas Gleixner's avatar Thomas Gleixner Committed by Ingo Molnar
Browse files

locking/rtmutex: Switch to from cmpxchg_*() to try_cmpxchg_*()



Allows the compiler to generate better code depending on the architecture.

Suggested-by: default avatarPeter Zijlstra <peterz@infradead.org>
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
Link: https://lore.kernel.org/r/20210815211302.668958502@linutronix.de
parent 78515930
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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);
}

/*