[PATCH] Remove catomics
Adhemerval Zanella
adhemerval.zanella@linaro.org
Wed Jul 6 12:15:10 GMT 2022
> On 5 Jul 2022, at 08:16, Wilco Dijkstra <Wilco.Dijkstra@arm.com> wrote:
>
> Hi Adhemerval,
>
>> Since this patch removes a x86 optimization (sorry, I realized it after my review),
>> I think it would be better if circle back and first get my single-thread refactor
>> patches in (which fixes SINGLE_THREAD_P syscall on aarch64 and other architectures)
>> since it does not change x86.
>
> It's a typical target "optimization" - not only slower but also functionally incorrect...
My idea is just to avoid unintentional breakage or performance regression
on some architecture.
>
>> After we can then remove the unused catomic operation and make the single-thread
>> optimization locking generic (so we can finally remove x86 arch-specific bits).
>
> I'm not sure I'm following - the catomics are not used in any locks or in performance
> critical code that could benefit from single-threaded optimizations. In fact my patch
> improves performance by using much faster relaxed atomics (since all we need is
> atomicity for the counter increments).
Initially I though atomic were being used on x86 on malloc code, but
working on removing the old atomic usage I see that current it only make
difference on some counters where relaxed atomic are indeed a better
solution (since you already added the single-thread path on generic
code).
So I withdraw my objection and the patch approach is ok. You might
need to send a newer version or if you may I can adjust it and
add my single-thread.h removal on top of it.
>
> Single-threaded locking optimizations are completely independent of all this, and so is
> your SINGLE_THREAD_P patch.
>
> So the only concern here is rebase clashes due to your patch rewriting all the x86 code.
> My point is that this unnecessary. The catomics are useless and all of the target specific
> code can be removed since it is either unused already or will be soon after follow-up
> patches. So why first rewrite it all? It just seems lots of work for no gain...
>
> Cheers,
> Wilco
More information about the Libc-alpha
mailing list