Re: [PATCH] locking/rtmutex: remove unused cmpxchg_relaxed

From: Thomas Gleixner
Date: Fri Jan 31 2020 - 15:23:47 EST


Davidlohr Bueso <dave@xxxxxxxxxxxx> writes:
> On Tue, 21 Jan 2020, Alex Shi wrote:

Subject: locking/rtmutex: remove unused cmpxchg_relaxed

should be

Subject: locking/rtmutex: Remove unused rt_mutex_cmpxchg_relaxed()

You're not removing cmpxchg_relaxed, right?

>> No one use this macro after it was introduced. Better to remove it?

Please make that factual.

The macro was never used at all. Remove it.

> You also need to remove it for the CONFIG_DEBUG_RT_MUTEXES=y case.

Yes.

> Hmm unrelated, but do we want CCAS for rtmutex fastpath? Ie:
>
> (l->owner == c && cmpxchg_acquire(&l->owner, c, n) == c)
>
> That would optimize for the contended case and avoid the cmpxchg - it would
> also help if we ever do the top-waiter spin thing.

Not sure if it buys much, but it kinda makes sense.

Thanks,

tglx