From: Sunil Pandey <skpgkp2@gmail.com>
To: "H.J. Lu" <hjl.tools@gmail.com>
Cc: Noah Goldstein <goldstein.w.n@gmail.com>,
GNU C Library <libc-alpha@sourceware.org>
Subject: Re: [PATCH v1 1/3] x86: Fix misordered logic for setting `rep_movsb_stop_threshold`
Date: Wed, 13 Jul 2022 19:53:11 -0700 [thread overview]
Message-ID: <CAMAf5_cB4_84VtbOnBB8UB=ZC2mcE9Ju9chZyjVW3pM+3KOn3w@mail.gmail.com> (raw)
In-Reply-To: <CAMe9rOqciL2vscSW7ZOOK8bhFL0T9_Xwk-CgF8xRizswkt+ZgQ@mail.gmail.com>
On Tue, Jun 14, 2022 at 6:03 PM H.J. Lu via Libc-alpha
<libc-alpha@sourceware.org> wrote:
>
> On Tue, Jun 14, 2022 at 5:25 PM Noah Goldstein <goldstein.w.n@gmail.com> wrote:
> >
> > Move the setting of `rep_movsb_stop_threshold` to after the tunables
> > have been collected so that the `rep_movsb_stop_threshold` (which
> > is used to redirect control flow to the non_temporal case) will
> > use any user value for `non_temporal_threshold` (set using
> > glibc.cpu.x86_non_temporal_threshold)
> > ---
> > sysdeps/x86/dl-cacheinfo.h | 24 ++++++++++++------------
> > 1 file changed, 12 insertions(+), 12 deletions(-)
> >
> > diff --git a/sysdeps/x86/dl-cacheinfo.h b/sysdeps/x86/dl-cacheinfo.h
> > index f64a2fb0ba..cc3b840f9c 100644
> > --- a/sysdeps/x86/dl-cacheinfo.h
> > +++ b/sysdeps/x86/dl-cacheinfo.h
> > @@ -898,18 +898,6 @@ dl_init_cacheinfo (struct cpu_features *cpu_features)
> > if (CPU_FEATURE_USABLE_P (cpu_features, FSRM))
> > rep_movsb_threshold = 2112;
> >
> > - unsigned long int rep_movsb_stop_threshold;
> > - /* ERMS feature is implemented from AMD Zen3 architecture and it is
> > - performing poorly for data above L2 cache size. Henceforth, adding
> > - an upper bound threshold parameter to limit the usage of Enhanced
> > - REP MOVSB operations and setting its value to L2 cache size. */
> > - if (cpu_features->basic.kind == arch_kind_amd)
> > - rep_movsb_stop_threshold = core;
> > - /* Setting the upper bound of ERMS to the computed value of
> > - non-temporal threshold for architectures other than AMD. */
> > - else
> > - rep_movsb_stop_threshold = non_temporal_threshold;
> > -
> > /* The default threshold to use Enhanced REP STOSB. */
> > unsigned long int rep_stosb_threshold = 2048;
> >
> > @@ -951,6 +939,18 @@ dl_init_cacheinfo (struct cpu_features *cpu_features)
> > SIZE_MAX);
> > #endif
> >
> > + unsigned long int rep_movsb_stop_threshold;
> > + /* ERMS feature is implemented from AMD Zen3 architecture and it is
> > + performing poorly for data above L2 cache size. Henceforth, adding
> > + an upper bound threshold parameter to limit the usage of Enhanced
> > + REP MOVSB operations and setting its value to L2 cache size. */
> > + if (cpu_features->basic.kind == arch_kind_amd)
> > + rep_movsb_stop_threshold = core;
> > + /* Setting the upper bound of ERMS to the computed value of
> > + non-temporal threshold for architectures other than AMD. */
> > + else
> > + rep_movsb_stop_threshold = non_temporal_threshold;
> > +
> > cpu_features->data_cache_size = data;
> > cpu_features->shared_cache_size = shared;
> > cpu_features->non_temporal_threshold = non_temporal_threshold;
> > --
> > 2.34.1
> >
>
> LGTM.
>
> Thanks.
>
> --
> H.J.
I would like to backport this patch to release branches.
Any comments or objections?
--Sunil
prev parent reply other threads:[~2022-07-14 2:53 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-15 0:25 Noah Goldstein
2022-06-15 0:25 ` [PATCH v1 2/3] x86: Cleanup bounds checking in large memcpy case Noah Goldstein
2022-06-15 1:07 ` H.J. Lu
2022-06-15 3:57 ` Noah Goldstein
2022-06-15 3:57 ` [PATCH v2] " Noah Goldstein
2022-06-15 14:52 ` H.J. Lu
2022-06-15 15:13 ` Noah Goldstein
2022-06-15 15:12 ` [PATCH v3] " Noah Goldstein
2022-06-15 16:48 ` H.J. Lu
2022-06-15 17:44 ` Noah Goldstein
2022-06-15 17:41 ` [PATCH v4 1/2] " Noah Goldstein
2022-06-15 17:41 ` [PATCH v4 2/2] x86: Add bounds `x86_non_temporal_threshold` Noah Goldstein
2022-06-15 18:22 ` H.J. Lu
2022-06-15 18:33 ` Noah Goldstein
2022-06-15 18:32 ` [PATCH v5 " Noah Goldstein
2022-06-15 18:43 ` H.J. Lu
2022-06-15 19:52 ` [PATCH v6 2/3] " Noah Goldstein
2022-06-15 20:27 ` H.J. Lu
2022-06-15 20:35 ` Noah Goldstein
2022-06-15 20:34 ` [PATCH v7 " Noah Goldstein
2022-06-15 20:48 ` H.J. Lu
2022-07-14 2:55 ` Sunil Pandey
2022-06-15 18:22 ` [PATCH v4 1/2] x86: Cleanup bounds checking in large memcpy case H.J. Lu
2022-07-14 2:57 ` Sunil Pandey
2022-06-15 0:25 ` [PATCH v1 3/3] x86: Add sse42 implementation to strcmp's ifunc Noah Goldstein
2022-06-15 1:08 ` H.J. Lu
2022-07-14 2:54 ` Sunil Pandey
2022-06-15 1:02 ` [PATCH v1 1/3] x86: Fix misordered logic for setting `rep_movsb_stop_threshold` H.J. Lu
2022-07-14 2:53 ` Sunil Pandey [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='CAMAf5_cB4_84VtbOnBB8UB=ZC2mcE9Ju9chZyjVW3pM+3KOn3w@mail.gmail.com' \
--to=skpgkp2@gmail.com \
--cc=goldstein.w.n@gmail.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).