public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Wilco Dijkstra <Wilco.Dijkstra@arm.com>
To: Andrew Pinski <pinskia@gmail.com>,
	Siddhesh Poyarekar <siddhesh@gotplt.org>
Cc: Szabolcs Nagy <Szabolcs.Nagy@arm.com>,
	"Ellcey, Steve" <Steve.Ellcey@cavium.com>,
	libc-alpha <libc-alpha@sourceware.org>, nd <nd@arm.com>
Subject: Re: Ping: [Patch] aarch64: Thunderx specific memcpy and memmove
Date: Thu, 25 May 2017 17:49:00 -0000	[thread overview]
Message-ID: <AM5PR0802MB26104227EC9F325E95C80D0883FF0@AM5PR0802MB2610.eurprd08.prod.outlook.com> (raw)
In-Reply-To: <CA+=Sn1nwmW++JVH+ibFpC=80pByaSGWnB6MNGY0vsU8T5vV=-g@mail.gmail.com>

Andrew Pinski <pinskia@gmail.com> wrote:
> 
> One memcpy does not fit all micro-arch.  Just look at x86, where they
> have many different versions and even do selection based on cache size
> (see the current discussion about the memcpy regression).

Given the number of micro architectures already existing, it would be a really
bad situation to end up with one memcpy per micro architecture...

Micro architectures will tend to converge rather than diverge as performance
level increases. So I believe it's generally best to use the same instructions for
memcpy as for compiled code as that is what CPUs will actually encounter
and optimize for. For the rare, very large copies we could do something different
if it helps (eg. prefetch, non-temporals, SIMD registers etc).

> >> - non-thunderx systems are affected: static linked code using
> >> memcpy will start to go through an indirection (iplt) instead
> >> of direct call. if there are complaints about it or other ifunc
> >> related issues come up, then again we will have to reconsider it.
>
> Just to answer this.  This is true on x86 and PowerPC already so there
> should be no difference on aarch64 than those two targets.

An ifunc has a measurable overhead unfortunately, and that would no longer
be trivially avoidable via static linking. Most calls to memcpy tend to be very
small copies. Maybe we should investigate statically linking the small copy part
of memcpy with say -O3?

Cheers,
Wilco

  parent reply	other threads:[~2017-05-25 17:49 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-01 18:27 Steve Ellcey
2017-05-01 21:20 ` Wainer dos Santos Moschetta
2017-05-03 14:01 ` Szabolcs Nagy
2017-05-09  3:17   ` Siddhesh Poyarekar
2017-05-09 21:45     ` Steve Ellcey
2017-05-18 21:48       ` Steve Ellcey
2017-05-19  7:41       ` Siddhesh Poyarekar
     [not found]         ` <DM5PR07MB34662F805C1EDE45882B82F6F5F90@DM5PR07MB3466.namprd07.prod.outlook.com>
2017-05-24 17:04           ` Szabolcs Nagy
2017-05-25  6:42             ` Siddhesh Poyarekar
2017-05-25 16:28               ` Andrew Pinski
2017-05-25 16:43                 ` Ramana Radhakrishnan
2017-05-25 17:49                 ` Wilco Dijkstra [this message]
2017-05-25 19:26                   ` Siddhesh Poyarekar
2017-05-25 21:04                     ` Ramana Radhakrishnan
2017-05-25 21:12                       ` Florian Weimer
2017-05-26  5:42                         ` Siddhesh Poyarekar
2017-05-26  5:34                       ` Siddhesh Poyarekar
2017-05-26  5:38                         ` Andrew Pinski
2017-05-25 16:22             ` Steve Ellcey

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=AM5PR0802MB26104227EC9F325E95C80D0883FF0@AM5PR0802MB2610.eurprd08.prod.outlook.com \
    --to=wilco.dijkstra@arm.com \
    --cc=Steve.Ellcey@cavium.com \
    --cc=Szabolcs.Nagy@arm.com \
    --cc=libc-alpha@sourceware.org \
    --cc=nd@arm.com \
    --cc=pinskia@gmail.com \
    --cc=siddhesh@gotplt.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).