From: Erich Elsen <eriche@google.com>
To: "H.J. Lu" <hjl.tools@gmail.com>
Cc: "Carlos O'Donell" <carlos@redhat.com>,
GNU C Library <libc-alpha@sourceware.org>
Subject: Re: memcpy performance regressions 2.19 -> 2.24(5)
Date: Thu, 18 May 2017 20:59:00 -0000 [thread overview]
Message-ID: <CAOVZoANj7Oqu66oXcfn-Fmi5UHVaxBRd-bkxVbaSr3bWUPXaXg@mail.gmail.com> (raw)
In-Reply-To: <CAMe9rOrznBXKWHL5bOUSs75A96j_5jiHF+W+D-U3tusYpbwp0Q@mail.gmail.com>
Hi H.J.,
I was on vacation, sorry for the slow reply. The updated benchmark
still shows the same behavior, thanks.
I'll try my hand at creating a patch that makes that variable
__x86_shared_non_temporal_threshold a tunable. It will be necessary
to do internal experiments anyway.
Best,
Erich
On Fri, May 12, 2017 at 2:20 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
> On Fri, May 12, 2017 at 1:21 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
>> On Fri, May 12, 2017 at 12:43 PM, Erich Elsen <eriche@google.com> wrote:
>>> HJ - yes, the benchmark still shows the same behavior. I did have to modify
>>> the build to add -std=c++11.
>>
>> I updated hjl/x86/optimize branch with memcpy_benchmark2.cc
>> to change its output for easy comparison. Please take a look to see
>> if it is still valid.
>>
>> H.J.
>>> Carlos - Maybe the first step is to add a tunable that allows for selection
>>> of the non-temporal-store size threshold without changing the implementation
>>> that is selected. I can work on submitting this patch.
>
> There are
>
> /* The large memcpy micro benchmark in glibc shows that 6 times of
> shared cache size is the approximate value above which non-temporal
> store becomes faster. */
> __x86_shared_non_temporal_threshold = __x86_shared_cache_size * 6;
>
> I did the measurement on a 8-core processor. 6 / 8 is .75 of the shared
> cache. But on processors with 56 cores, 6 / 56 may be too small.
>
> H.J.
>>> On Wed, May 10, 2017 at 7:17 PM, Carlos O'Donell <carlos@redhat.com> wrote:
>>>>
>>>> On 05/10/2017 01:33 PM, H.J. Lu wrote:
>>>> > On Tue, May 9, 2017 at 4:48 PM, Erich Elsen <eriche@google.com> wrote:
>>>> >> store is a net win even though it causes a 2-3x decrease in single
>>>> >> threaded performance for some processors? Or how else is the decision
>>>> >> about the threshold made?
>>>> >
>>>> > There is no perfect number to make everyone happy. I am open
>>>> > to suggestion to improve the compromise.
>>>> >
>>>> > H.J.
>>>>
>>>> I agree with H.J., there is a compromise to be made here. Having a single
>>>> process thrash the box by taking all of the memory bandwidth might be
>>>> sensible for a microservice, but glibc has to default to something that
>>>> works well on average.
>>>>
>>>> With the new tunables infrastructure we can start talking about ways in
>>>> which a tunable could influence IFUNC selection though, allowing users
>>>> some kind of choice into tweaking for single-threaded or multi-threaded,
>>>> single-user or multi-user etc.
>>>>
>>>> What I would like to see as the output of any discussion is a set of
>>>> microbenchmarks (benchtests/) added to glibc that are the distillation
>>>> of whatever workload we're talking about here. This is crucial to the
>>>> community having a way to test from release-to-release that we don't
>>>> regress performance.
>>>>
>>>> Unless you want to sign up to test your workload at every release then
>>>> we need this kind of microbenchmark addition. And microbenchmarks are
>>>> dead-easy to integrate with glibc so most people should have no excuse.
>>>>
>>>> The hardware vendors and distros who want particular performance tests
>>>> are putting such tests in place (representative of their users), and
>>>> direct
>>>> end-users who want particular performance are also adding tests.
>>>>
>>>> --
>>>> Cheers,
>>>> Carlos.
>>>
>>>
>>
>>
>>
>> --
>> H.J.
>
>
>
> --
> H.J.
next prev parent reply other threads:[~2017-05-18 20:59 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-05 17:09 Erich Elsen
2017-05-05 18:09 ` Carlos O'Donell
2017-05-06 0:57 ` Erich Elsen
2017-05-06 15:41 ` H.J. Lu
2017-05-09 23:48 ` Erich Elsen
2017-05-10 17:33 ` H.J. Lu
2017-05-11 2:17 ` Carlos O'Donell
2017-05-12 19:47 ` Erich Elsen
[not found] ` <CAOVZoAPp3_T+ourRkNFXHfCSQUOMFn4iBBm9j50==h=VJcGSzw@mail.gmail.com>
2017-05-12 20:21 ` H.J. Lu
2017-05-12 21:21 ` H.J. Lu
2017-05-18 20:59 ` Erich Elsen [this message]
2017-05-22 19:17 ` H.J. Lu
2017-05-22 20:22 ` H.J. Lu
2017-05-23 1:23 ` Erich Elsen
2017-05-23 2:25 ` H.J. Lu
2017-05-23 3:19 ` Erich Elsen
2017-05-23 20:39 ` Erich Elsen
2017-05-23 20:46 ` H.J. Lu
2017-05-23 20:57 ` Erich Elsen
2017-05-23 22:08 ` H.J. Lu
2017-05-23 22:12 ` Erich Elsen
2017-05-23 22:55 ` H.J. Lu
2017-05-24 0:56 ` Erich Elsen
2017-05-24 3:42 ` H.J. Lu
2017-05-24 21:03 ` Erich Elsen
2017-05-24 21:36 ` H.J. Lu
2017-05-25 21:23 ` Erich Elsen
2017-05-25 21:57 ` Erich Elsen
2017-05-25 22:03 ` H.J. Lu
2017-05-27 0:31 ` Erich Elsen
2017-05-27 21:35 ` H.J. Lu
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=CAOVZoANj7Oqu66oXcfn-Fmi5UHVaxBRd-bkxVbaSr3bWUPXaXg@mail.gmail.com \
--to=eriche@google.com \
--cc=carlos@redhat.com \
--cc=hjl.tools@gmail.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).