public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
To: Wilco Dijkstra <Wilco.Dijkstra@arm.com>
Cc: GNU C Library <libc-alpha@sourceware.org>
Subject: Re: [PATCH] Remove catomics
Date: Wed, 6 Jul 2022 09:15:10 -0300	[thread overview]
Message-ID: <69C77881-04B0-41F1-8DD7-3DC78E89B4BE@linaro.org> (raw)
In-Reply-To: <AM5PR0801MB16687EADE28456267CBF458983819@AM5PR0801MB1668.eurprd08.prod.outlook.com>



> 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


      reply	other threads:[~2022-07-06 12:15 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-16 10:01 Wilco Dijkstra
2022-06-16 20:06 ` Adhemerval Zanella
2022-06-17 11:56   ` Wilco Dijkstra
2022-06-22 13:00     ` Adhemerval Zanella
2022-07-05 11:16       ` Wilco Dijkstra
2022-07-06 12:15         ` Adhemerval Zanella [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=69C77881-04B0-41F1-8DD7-3DC78E89B4BE@linaro.org \
    --to=adhemerval.zanella@linaro.org \
    --cc=Wilco.Dijkstra@arm.com \
    --cc=libc-alpha@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).