From: Noah Goldstein <goldstein.w.n@gmail.com>
To: Sajan Karumanchi <sajan.karumanchi@gmail.com>
Cc: premachandra.mallappa@amd.com, dj@redhat.com,
hjl.tools@gmail.com, libc-alpha@sourceware.org,
carlos@systemhalted.org
Subject: Re:
Date: Mon, 10 Jul 2023 10:58:09 -0500 [thread overview]
Message-ID: <CAFUsyfK010-UYMYOdrc3tERCVxgv+is=1jevaoPx0rLNCo8v2g@mail.gmail.com> (raw)
In-Reply-To: <20230710052317.828308-1-sajan.karumanchi@amd.com>
On Mon, Jul 10, 2023 at 12:23 AM Sajan Karumanchi
<sajan.karumanchi@gmail.com> wrote:
>
> Noah,
> I verified your patches on the master branch that impacts the non-threshold
> parameter on x86 CPUs. This patch modifies the non-temporal threshold value
> from 24MB(3/4th of L3$) to 8MB(1/4th of L3$) on ZEN4.
> From the Glibc benchmarks, we saw a significant performance drop ranging
> from 15% to 99% for size ranges of 8MB to 16MB.
> I also ran the new tool developed by you on all Zen architectures and the
> results conclude that 3/4th L3 size holds good on AMD CPUs.
> Hence the current patch degrades the performance of AMD CPUs.
> We strongly recommend marking this change to Intel CPUs only.
>
So it shouldn't actually go down. I think what is missing is:
```
get_common_cache_info (&shared, &shared_per_thread, &threads, core);
```
In the AMD case shared == shared_per_thread which shouldn't really
be the case.
The intended new calculation is: Total_L3_Size / Scale
as opposed to: (L3_Size / NThread) / Scale"
Before just going with default for AMD, maybe try out the following patch?
```
---
sysdeps/x86/dl-cacheinfo.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/sysdeps/x86/dl-cacheinfo.h b/sysdeps/x86/dl-cacheinfo.h
index c98fa57a7b..c1866ca898 100644
--- a/sysdeps/x86/dl-cacheinfo.h
+++ b/sysdeps/x86/dl-cacheinfo.h
@@ -717,6 +717,7 @@ dl_init_cacheinfo (struct cpu_features *cpu_features)
level3_cache_assoc = handle_amd (_SC_LEVEL3_CACHE_ASSOC);
level3_cache_linesize = handle_amd (_SC_LEVEL3_CACHE_LINESIZE);
+ get_common_cache_info (&shared, &shared_per_thread, &threads, core);
if (shared <= 0)
/* No shared L3 cache. All we have is the L2 cache. */
shared = core;
--
2.34.1
```
> Thanks,
> Sajan K.
>
next prev parent reply other threads:[~2023-07-10 15:58 UTC|newest]
Thread overview: 80+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-24 5:03 [PATCH v1] x86: Increase `non_temporal_threshold` to roughly `sizeof_L3 / 2` Noah Goldstein
2023-04-24 18:09 ` H.J. Lu
2023-04-24 18:34 ` Noah Goldstein
2023-04-24 20:44 ` H.J. Lu
2023-04-24 22:30 ` Noah Goldstein
2023-04-24 22:30 ` [PATCH v2] " Noah Goldstein
2023-04-24 22:48 ` H.J. Lu
2023-04-25 2:05 ` Noah Goldstein
2023-04-25 2:55 ` H.J. Lu
2023-04-25 3:43 ` Noah Goldstein
2023-04-25 3:43 ` [PATCH v3] " Noah Goldstein
2023-04-25 17:42 ` H.J. Lu
2023-04-25 21:45 ` Noah Goldstein
2023-04-25 21:45 ` [PATCH v4] " Noah Goldstein
2023-04-26 15:59 ` H.J. Lu
2023-04-26 17:15 ` Noah Goldstein
2023-05-04 3:28 ` Noah Goldstein
2023-05-05 18:06 ` H.J. Lu
2023-05-09 3:14 ` Noah Goldstein
2023-05-09 3:13 ` [PATCH v5 1/3] x86: Increase `non_temporal_threshold` to roughly `sizeof_L3 / 4` Noah Goldstein
2023-05-09 3:13 ` [PATCH v5 2/3] x86: Refactor Intel `init_cpu_features` Noah Goldstein
2023-05-09 21:58 ` H.J. Lu
2023-05-10 0:33 ` Noah Goldstein
2023-05-09 3:13 ` [PATCH v5 3/3] x86: Make the divisor in setting `non_temporal_threshold` cpu specific Noah Goldstein
2023-05-10 0:33 ` [PATCH v6 1/4] x86: Increase `non_temporal_threshold` to roughly `sizeof_L3 / 4` Noah Goldstein
2023-05-10 0:33 ` [PATCH v6 2/4] x86: Refactor Intel `init_cpu_features` Noah Goldstein
2023-05-10 22:13 ` H.J. Lu
2023-05-10 23:17 ` Noah Goldstein
2023-05-11 21:36 ` H.J. Lu
2023-05-12 5:11 ` Noah Goldstein
2023-05-10 0:33 ` [PATCH v6 3/4] x86: Make the divisor in setting `non_temporal_threshold` cpu specific Noah Goldstein
2023-05-10 0:33 ` [PATCH v6 4/4] x86: Tune 'Saltwell' microarch the same was a 'Bonnell' Noah Goldstein
2023-05-10 22:04 ` H.J. Lu
2023-05-10 22:12 ` Noah Goldstein
2023-05-10 15:55 ` [PATCH v6 1/4] x86: Increase `non_temporal_threshold` to roughly `sizeof_L3 / 4` H.J. Lu
2023-05-10 16:07 ` Noah Goldstein
2023-05-10 22:12 ` [PATCH v7 2/4] x86: Refactor Intel `init_cpu_features` Noah Goldstein
2023-05-10 22:12 ` [PATCH v7 3/4] x86: Make the divisor in setting `non_temporal_threshold` cpu specific Noah Goldstein
2023-05-10 22:12 ` [PATCH v7 4/4] x86: Tune 'Saltwell' microarch the same was a 'Bonnell' Noah Goldstein
2023-05-12 5:12 ` Noah Goldstein
2023-05-12 5:10 ` [PATCH v8 1/3] x86: Increase `non_temporal_threshold` to roughly `sizeof_L3 / 4` Noah Goldstein
2023-05-12 5:10 ` [PATCH v8 2/3] x86: Refactor Intel `init_cpu_features` Noah Goldstein
2023-05-12 22:17 ` H.J. Lu
2023-05-13 5:18 ` Noah Goldstein
2023-05-12 22:03 ` [PATCH v8 3/3] x86: Make the divisor in setting `non_temporal_threshold` cpu specific Noah Goldstein
2023-05-13 5:19 ` [PATCH v9 1/3] x86: Increase `non_temporal_threshold` to roughly `sizeof_L3 / 4` Noah Goldstein
2023-05-13 5:19 ` [PATCH v9 2/3] x86: Refactor Intel `init_cpu_features` Noah Goldstein
2023-05-15 20:57 ` H.J. Lu
2023-05-26 3:34 ` DJ Delorie
2023-05-27 18:46 ` Noah Goldstein
2023-05-13 5:19 ` [PATCH v9 3/3] x86: Make the divisor in setting `non_temporal_threshold` cpu specific Noah Goldstein
2023-05-26 3:34 ` DJ Delorie
2023-05-27 18:46 ` Noah Goldstein
2023-05-15 18:29 ` [PATCH v9 1/3] x86: Increase `non_temporal_threshold` to roughly `sizeof_L3 / 4` Noah Goldstein
2023-05-17 12:00 ` Carlos O'Donell
2023-05-26 3:34 ` DJ Delorie
2023-05-27 18:46 ` [PATCH v10 " Noah Goldstein
2023-05-27 18:46 ` [PATCH v10 2/3] x86: Refactor Intel `init_cpu_features` Noah Goldstein
2023-05-27 18:46 ` [PATCH v10 3/3] x86: Make the divisor in setting `non_temporal_threshold` cpu specific Noah Goldstein
2023-05-31 2:33 ` DJ Delorie
2023-07-10 5:23 ` Sajan Karumanchi
2023-07-10 15:58 ` Noah Goldstein [this message]
2023-07-14 2:21 ` Noah Goldstein
2023-07-14 7:39 ` Re: sajan karumanchi
2023-06-07 0:15 ` [PATCH v10 1/3] x86: Increase `non_temporal_threshold` to roughly `sizeof_L3 / 4` Carlos O'Donell
2023-06-07 18:18 ` Noah Goldstein
2023-06-07 18:18 ` [PATCH v11 " Noah Goldstein
2023-06-07 18:18 ` [PATCH v11 2/3] x86: Refactor Intel `init_cpu_features` Noah Goldstein
2023-06-07 18:18 ` [PATCH v11 3/3] x86: Make the divisor in setting `non_temporal_threshold` cpu specific Noah Goldstein
2023-06-07 18:19 ` [PATCH v11 1/3] x86: Increase `non_temporal_threshold` to roughly `sizeof_L3 / 4` Noah Goldstein
2023-08-14 23:00 ` Noah Goldstein
2023-08-22 15:11 ` Noah Goldstein
2023-08-24 17:06 ` Noah Goldstein
2023-08-28 20:02 ` Noah Goldstein
2023-09-05 15:37 ` Noah Goldstein
2023-09-12 3:50 ` Noah Goldstein
-- strict thread matches above, loose matches on Subject: below --
2023-01-13 5:41 father.dominic
2021-06-06 19:19 Davidlohr Bueso
2021-06-07 16:02 ` André Almeida
[not found] <1481545990-7247-1-git-send-email-adhemerval.zanella@linaro.org>
2016-12-19 18:18 ` Re: Adhemerval Zanella
2005-07-15 21:51 Re: ИнфоПространство
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='CAFUsyfK010-UYMYOdrc3tERCVxgv+is=1jevaoPx0rLNCo8v2g@mail.gmail.com' \
--to=goldstein.w.n@gmail.com \
--cc=carlos@systemhalted.org \
--cc=dj@redhat.com \
--cc=hjl.tools@gmail.com \
--cc=libc-alpha@sourceware.org \
--cc=premachandra.mallappa@amd.com \
--cc=sajan.karumanchi@gmail.com \
/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).