summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2017-05-12 13:38:04 -0700
committerH.J. Lu <hjl.tools@gmail.com>2017-05-29 06:47:22 -0700
commitcccc2db76b3f39a2feaebfbbceccd6d69b0958eb (patch)
tree401e693f3efe3dc165123107a2cb6e05214da560
parent1a458dd772f021067a3def3ce0d85301cccc6688 (diff)
downloadglibc-hjl/master.tar.gz
x86: Update __x86_shared_non_temporal_thresholdhjl/master
__x86_shared_non_temporal_threshold was set to 6 times of per-core shared cache size, based on the large memcpy micro benchmark in glibc on a 8-core processor. For a processor with more than 8 cores, the threshold is too low. Set __x86_shared_non_temporal_threshold to the 3/4 of the total shared cache size so that it is unchanged on 8-core processors. On processors with less than 8 cores, the threshold is lower. * sysdeps/x86/cacheinfo.c (__x86_shared_non_temporal_threshold): Set to the 3/4 of the total shared cache size.
-rw-r--r--sysdeps/x86/cacheinfo.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sysdeps/x86/cacheinfo.c b/sysdeps/x86/cacheinfo.c
index 12ffeef5b5..f66f2b86e0 100644
--- a/sysdeps/x86/cacheinfo.c
+++ b/sysdeps/x86/cacheinfo.c
@@ -767,8 +767,10 @@ intel_bug_no_cache_info:
/* 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;
+ store becomes faster on a 8-core processor. This is the 3/4 of the
+ total shared cache size. */
+ __x86_shared_non_temporal_threshold
+ = __x86_shared_cache_size * threads * 3 / 4;
}
#endif