diff --git a/0010-do-not-set-the-local-policy-MPOL_LOCAL.patch b/0010-do-not-set-the-local-policy-MPOL_LOCAL.patch new file mode 100644 index 0000000000000000000000000000000000000000..ea8b7d2dd0fdc8eab66b544e83d69755bacf5075 --- /dev/null +++ b/0010-do-not-set-the-local-policy-MPOL_LOCAL.patch @@ -0,0 +1,91 @@ +From c48be67742a69207d49ecf66d0bfb26ae2d31d20 Mon Sep 17 00:00:00 2001 +From: rpm-build +Date: Tue, 15 Apr 2025 18:59:51 +0800 +Subject: [PATCH 1/1] do not set the local policy MPOL_LOCAL to make the +speccpu test succeess. + +rollback the upstream commit: https://github.com/numactl/numactl/commit/9f0d8a633895eb662f96bbbaad07522d4a852e0d + +--- + libnuma.c | 8 ++++---- + numactl.c | 2 +- + util.c | 3 +-- + 3 files changed, 6 insertions(+), 7 deletions(-) + +diff --git a/libnuma.c b/libnuma.c +index b5bf616..7fc71de 100644 +--- a/libnuma.c ++++ b/libnuma.c +@@ -926,7 +926,7 @@ numa_tonodemask_memory_v2(void *mem, size_t size, struct bitmask *bmp) + + void numa_setlocal_memory(void *mem, size_t size) + { +- dombind(mem, size, MPOL_LOCAL, NULL); ++ dombind(mem, size, MPOL_PREFERRED, NULL); + } + + void numa_police_memory(void *mem, size_t size) +@@ -1118,7 +1118,7 @@ void *numa_alloc_local(size_t size) + if (mem == (char *)-1) + mem = NULL; + else +- dombind(mem, size, MPOL_LOCAL, NULL); ++ dombind(mem, size, MPOL_PREFERRED, NULL); + return mem; + } + +@@ -1927,7 +1927,7 @@ static void __numa_set_preferred(struct bitmask *bmp) + numa_error(__FILE__); + } + +- setpol(nodes ? MPOL_PREFERRED : MPOL_LOCAL, bmp); ++ setpol(nodes ? MPOL_PREFERRED : MPOL_PREFERRED, bmp); + } + + void numa_set_preferred(int node) +@@ -1968,7 +1968,7 @@ struct bitmask *numa_preferred_many() + + void numa_set_localalloc(void) + { +- setpol(MPOL_LOCAL, numa_no_nodes_ptr); ++ setpol(MPOL_PREFERRED, numa_no_nodes_ptr); + } + + SYMVER("numa_bind_v1", "numa_bind@libnuma_1.1") +diff --git a/numactl.c b/numactl.c +index 923be8c..505ae55 100755 +--- a/numactl.c ++++ b/numactl.c +@@ -631,7 +631,7 @@ int main(int ac, char **av) + break; + case 'l': /* --local */ + checknuma(); +- setpolicy(MPOL_LOCAL); ++ setpolicy(MPOL_DEFAULT); + errno = 0; + if (shmfd >= 0) + numa_setlocal_memory(shmptr, shmlen); +diff --git a/util.c b/util.c +index 8bdac5d..c1d2539 100644 +--- a/util.c ++++ b/util.c +@@ -87,7 +87,6 @@ static struct policy { + int noarg; + } policies[] = { + { "preferred-many", MPOL_PREFERRED_MANY, }, +- { "local", MPOL_LOCAL, 1 }, + { "interleave", MPOL_INTERLEAVE, }, + { "membind", MPOL_BIND, }, + { "preferred", MPOL_PREFERRED, }, +@@ -95,7 +94,7 @@ static struct policy { + { NULL }, + }; + +-static char *policy_names[] = { "default", "preferred", "bind", "interleave", "local", "preferred-many" }; ++static char *policy_names[] = { "default", "preferred", "bind", "interleave", "preferred-many" }; + + char *policy_name(int policy) + { +-- +2.43.5 + diff --git a/numactl.spec b/numactl.spec index 76071dbee7f85f6b82f8e6fe7bb4702245de22ad..9d974e42eb6b9509e361a33b546da23732efe10c 100644 --- a/numactl.spec +++ b/numactl.spec @@ -1,4 +1,4 @@ -%define anolis_release .0.2 +%define anolis_release .0.3 Name: numactl Summary: Library for tuning for Non Uniform Memory Access machines Version: 2.0.18 @@ -47,9 +47,9 @@ Patch605: 0005-numactl-Add-documentation-for-weighted-interleave.patch Patch606: 0006-Don-t-fail-build-when-set_mempolicy_home_node-syscal.patch Patch607: 0007-numastat-eliminate-hard-coded-tables.patch Patch608: 0008-Update-numactl.c.patch +Patch610: 0010-do-not-set-the-local-policy-MPOL_LOCAL.patch Patch1001: 1001-Save-and-restore-errno-when-probing-for-SET_PREFERRE.patch - %description Simple NUMA policy support. It consists of a numactl program to run other programs with a specific NUMA policy. @@ -126,6 +126,9 @@ rm -rf $RPM_BUILD_ROOT %doc README.md %changelog +* Wed Apr 16 2025 wh02252983 - 2.0.18-1.0.3 +- rollback the MPOL_LOCAL to make the speccpu success in Haiguang + * Thu Dec 26 2024 wangzhe - 2.0.18-1.0.2 - Save and restore errno when probing for SET_PREFERRED_MANY