1 Star 0 Fork 47

May/glibc_2.38_anolis

forked from src-anolis-os/glibc 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0003-x86-Set-default-non_temporal_threshold-for-Zhaoxin-p.patch 2.21 KB
一键复制 编辑 原始数据 按行查看 历史
May 提交于 2025-01-20 19:52 . [Feature]Add support for Zhaoxin processors
From 43745f60e5ab28e861204d43b9d93cf6685200b5 Mon Sep 17 00:00:00 2001
From: May <[email protected]>
Date: Wed, 15 Jan 2025 19:00:48 +0800
Subject: [PATCH 3/3] x86: Set default non_temporal_threshold for Zhaoxin
processors
Current 'non_temporal_threshold' set to 'non_temporal_threshold_lowbound'
on Zhaoxin processors without ERMS. The default
'non_temporal_threshold_lowbound' is too small for the KH-40000 and KX-7000
Zhaoxin processors, this patch updates the value to
'shared / cachesize_non_temporal_divisor'.
Signed-off-by: May <[email protected]>
---
sysdeps/x86/cpu-features.c | 1 +
sysdeps/x86/dl-cacheinfo.h | 6 ++++--
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/sysdeps/x86/cpu-features.c b/sysdeps/x86/cpu-features.c
index 43b5f562..f752ebd2 100644
--- a/sysdeps/x86/cpu-features.c
+++ b/sysdeps/x86/cpu-features.c
@@ -949,6 +949,7 @@ https://www.intel.com/content/www/us/en/support/articles/000059422/processors.ht
/* Yongfeng and Shijidadao mircoarch tuning. */
case 0x5b:
+ cpu_features->cachesize_non_temporal_divisor = 2;
case 0x6b:
cpu_features->preferred[index_arch_AVX_Fast_Unaligned_Load]
&= ~bit_arch_AVX_Fast_Unaligned_Load;
diff --git a/sysdeps/x86/dl-cacheinfo.h b/sysdeps/x86/dl-cacheinfo.h
index cd4d0351..2c5b6d69 100644
--- a/sysdeps/x86/dl-cacheinfo.h
+++ b/sysdeps/x86/dl-cacheinfo.h
@@ -769,8 +769,10 @@ dl_init_cacheinfo (struct cpu_features *cpu_features)
/* If no ERMS, we use the per-thread L3 chunking. Normal cacheable stores run
a higher risk of actually thrashing the cache as they don't have a HW LRU
hint. As well, their performance in highly parallel situations is
- noticeably worse. */
- if (!CPU_FEATURE_USABLE_P (cpu_features, ERMS))
+ noticeably worse. Zhaoxin processors are an exception, the lowbound is not
+ suitable for them based on actual test data. */
+ if (!CPU_FEATURE_USABLE_P (cpu_features, ERMS)
+ && cpu_features->basic.kind != arch_kind_zhaoxin)
non_temporal_threshold = non_temporal_threshold_lowbound;
/* SIZE_MAX >> 4 because memmove-vec-unaligned-erms right-shifts the value of
'x86_non_temporal_threshold' by `LOG_4X_MEMCPY_THRESH` (4) and it is best
--
2.27.0
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/mayshao/glibc_2.38_anolis.git
[email protected]:mayshao/glibc_2.38_anolis.git
mayshao
glibc_2.38_anolis
glibc_2.38_anolis
a23

搜索帮助