Re: [PATCH v2 RESEND] locking/lockref/x86: Enable ARCH_USE_CMPXCHG_LOCKREF for X86_CMPXCHG64

From: Uros Bizjak
Date: Sat Sep 10 2022 - 02:28:42 EST


On Sun, Jul 3, 2022 at 11:01 PM Linus Torvalds
<torvalds@xxxxxxxxxxxxxxxxxxxx> wrote:
>
> On Sun, Jun 26, 2022 at 1:18 PM Uros Bizjak <ubizjak@xxxxxxxxx> 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".

May I consider this message as a formal Acked-by: for the patch? I'll
resubmit the patch with a commit message updated to reference
lockref_put_not_zero instead of the removed lockref_get_or_lock.

Thanks,
Uros.