Re: [PATCH v2 RESEND] locking/lockref/x86: Enable ARCH_USE_CMPXCHG_LOCKREF for X86_CMPXCHG64
From: Uros Bizjak
Date: Mon Sep 12 2022 - 05:26:52 EST
On Sat, Sep 10, 2022 at 7:23 PM Linus Torvalds
<torvalds@xxxxxxxxxxxxxxxxxxxx> wrote:
>
> On Sat, Sep 10, 2022 at 2:28 AM Uros Bizjak <ubizjak@xxxxxxxxx> wrote:
> >
> > 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.
>
> Sure, sounds good to me.
>
> It would be particularly nice if you can also see any change in
> performance numbers - but that simply may not be possible.
>
> 32-bit x86 tends to also be very low core count, so the whole lockref
> thing may or may not be measurable (no practical contention on the
> lock), but the code certainly seems to get better.
I tested this patch on an old core-2 duo in 32-bit mode, mainly to
test my try_cmpxchg64 patch on 32-bit targets. There were no
observable changes in the run time, but we are talking about a
two-core system here. OTOH, there were considerable code-size savings,
as noticed in my patch submission entry.
Please also note, that I am aware that changes to the default
configuration of 32-bit falls into the vintage computing nowadays.
However, a couple of enthusiast old-timers would still like to squeeze
some more juice out of their old rigs (e.g. m68k, alpha and x86-32) by
using all available processor infrastructure. OTOH, I don't want to
burden x86 maintainers with my hobby, but here we are talking about
such low-hanging fruit that it warrants the one-line change. By the
same patch, the default config can be cleaned a bit and made a bit
more consistent also for x86_64.
Thanks,
Uros.