Re: [PATCH] locking/rtmutex: remove unused cmpxchg_relaxed
From: Alex Shi
Date: Tue Feb 04 2020 - 05:18:11 EST
在 2020/2/1 上午4:23, Thomas Gleixner 写道:
> 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
>
Thanks Thomas and David!
Is this following patch ok?
Thanks
Alex
---