lkml.org 
[lkml]   [2022]   [Jul]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH v2 RESEND] locking/lockref/x86: Enable ARCH_USE_CMPXCHG_LOCKREF for X86_CMPXCHG64
On Sun, Jun 26, 2022 at 1:18 PM Uros Bizjak <ubizjak@gmail.com> wrote:
>
> Also, by using try_cmpxchg64() instead of cmpxchg64()
> in CMPXCHG_LOOP macro, the compiler actually produces sane code,
> improving lockref_get_or_lock main loop from:

Heh. I'm actually looking at that function because I committed my "add
sparse annotation for conditional locking" patch, and
lockref_get_or_lock() has the wrong "polarity" for conditional locking
(it returns false when it takes the lock).

But then I started looking closer, and that function has no users any
more. In fact, it hasn't had users since back in 2013.

So while I still think ARCH_USE_CMPXCHG_LOCKREF is fine for 32-bit
x86, the part about improving lockref_get_or_lock() code generation is
kind of pointless. I'm going to remove that function as "unused, and
with the wrong return value".

Linus

\
 
 \ /
  Last update: 2022-07-03 23:01    [W:0.063 / U:0.228 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site