diff mbox

memcpy performance regressions 2.19 -> 2.24(5)

Message ID CAOVZoAPiL6_aYEoKKCsTQVHDN4BopOiw6EyBe_8_sOtn1NXoWw@mail.gmail.com
State New
Headers show

Commit Message

Erich Elsen May 25, 2017, 9:57 p.m. UTC
It looks like you already added the non_temporal_threshold as part of
the cpu_features tunables?  Here's a small patch that allows the
cpu_features struct to be passed in.  This is useful if you need to be
able to call init_cacheinfo with cpu_features other than the global
ones.



On Thu, May 25, 2017 at 2:23 PM, Erich Elsen <eriche@google.com> wrote:
> Ok, will do.
>
> On Wed, May 24, 2017 at 2:36 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
>> On Mon, May 22, 2017 at 8:19 PM, Erich Elsen <eriche@google.com> wrote:
>>> Here is the patch that slightly refactors how init_cacheinfo is called.
>>>
>>
>> Please take a look at hjl/tunables/master branch.  You can add
>> non_temporal_threshold support on top of it.
>>
>>
>> --
>> H.J.

Comments

H.J. Lu May 25, 2017, 10:03 p.m. UTC | #1
On Thu, May 25, 2017 at 2:57 PM, Erich Elsen <eriche@google.com> wrote:
> It looks like you already added the non_temporal_threshold as part of
> the cpu_features tunables?  Here's a small patch that allows the

No, I didn't.  I only added cache info to CPU features.

> cpu_features struct to be passed in.  This is useful if you need to be
> able to call init_cacheinfo with cpu_features other than the global
> ones.

I need to see the complete working patch.

>
>
> On Thu, May 25, 2017 at 2:23 PM, Erich Elsen <eriche@google.com> wrote:
>> Ok, will do.
>>
>> On Wed, May 24, 2017 at 2:36 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
>>> On Mon, May 22, 2017 at 8:19 PM, Erich Elsen <eriche@google.com> wrote:
>>>> Here is the patch that slightly refactors how init_cacheinfo is called.
>>>>
>>>
>>> Please take a look at hjl/tunables/master branch.  You can add
>>> non_temporal_threshold support on top of it.
>>>
>>>
>>> --
>>> H.J.
diff mbox

Patch

From e3c27309fa45a6c50d0ed0e541dd82c406d4485a Mon Sep 17 00:00:00 2001
From: Erich Elsen <eriche@google.com>
Date: Thu, 25 May 2017 14:49:15 -0700
Subject: [PATCH] init_cacheinfo -> init_cacheinfo_impl which it is possible to
 pass a cpu_features struct to for modularity.

---
 sysdeps/x86/cacheinfo.c | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/sysdeps/x86/cacheinfo.c b/sysdeps/x86/cacheinfo.c
index a46dd4dc30..d1fcc9fb4b 100644
--- a/sysdeps/x86/cacheinfo.c
+++ b/sysdeps/x86/cacheinfo.c
@@ -482,9 +482,9 @@  int __x86_prefetchw attribute_hidden;
 #endif
 
 
-static void
-__attribute__((constructor))
-init_cacheinfo (void)
+void
+attribute_hidden
+init_cacheinfo_impl (const struct cpu_features* cpu_features)
 {
   /* Find out what brand of processor.  */
   unsigned int eax;
@@ -496,7 +496,6 @@  init_cacheinfo (void)
   long int shared = -1;
   unsigned int level;
   unsigned int threads = 0;
-  const struct cpu_features *cpu_features = __get_cpu_features ();
   int max_cpuid = cpu_features->max_cpuid;
 
   if (cpu_features->kind == arch_kind_intel)
@@ -787,4 +786,10 @@  intel_bug_no_cache_info:
        : __x86_shared_cache_size * 6);
 }
 
+static void
+__attribute__((constructor))
+init_cacheinfo (void) {
+  const struct cpu_features *cpu_features = __get_cpu_features ();
+  init_cacheinfo_impl(cpu_features);
+}
 #endif
-- 
2.13.0.219.gdb65acc882-goog