[PATCH] Add cache info to _dl_x86_cpu_features
H.J. Lu
hjl.tools@gmail.com
Tue May 10 23:49:00 GMT 2016
On Sun, May 8, 2016 at 8:57 AM, H.J. Lu <hjl.tools@gmail.com> wrote:
> Support setting processor-specific __x86_shared_non_temporal_threshold
> value in init_cpu_features.
>
> Tested on x86 and x86-64. Any comments and feebacks?
>
> H.J.
> ---
> * sysdeps/x86/cacheinfo.c (__x86_shared_non_temporal_threshold):
> Initialize only if it is zero.
> ---
> sysdeps/x86/cacheinfo.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/sysdeps/x86/cacheinfo.c b/sysdeps/x86/cacheinfo.c
> index 143b333..788f42d 100644
> --- a/sysdeps/x86/cacheinfo.c
> +++ b/sysdeps/x86/cacheinfo.c
> @@ -669,5 +669,6 @@ init_cacheinfo (void)
> /* 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;
> + if (__x86_shared_non_temporal_threshold == 0)
> + __x86_shared_non_temporal_threshold = __x86_shared_cache_size * 6;
> }
This doesn't work since init_cpu_features may only update the private copy
in ld.so. Instead, this patch adds cache info to _dl_x86_cpu_features so
that init_cpu_features sets cache size.
Any comments and feebacks?
--
H.J.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-X86-Add-cache-info-to-_dl_x86_cpu_features.patch
Type: text/x-patch
Size: 2971 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20160510/c49dab93/attachment.bin>
More information about the Libc-alpha
mailing list