From 20c42dfe211be8d906d8a9d3c196d402fc943364 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Aug 05 2015 16:35:39 +0000 Subject: import numactl-2.0.9-5.el7_1 --- diff --git a/SOURCES/numactl-2.0.10-numa_node_to_cpu_skip_over_nonexisting.patch b/SOURCES/numactl-2.0.10-numa_node_to_cpu_skip_over_nonexisting.patch new file mode 100644 index 0000000..8e1af68 --- /dev/null +++ b/SOURCES/numactl-2.0.10-numa_node_to_cpu_skip_over_nonexisting.patch @@ -0,0 +1,50 @@ +From 32075635db57c3d5efe12f8fb569af857e01ccad Mon Sep 17 00:00:00 2001 +From: Petr Holasek +Date: Wed, 14 Jan 2015 09:53:47 +0100 +Subject: [PATCH] libnuma: add check for return value of numa_node_to_cpus + +When numa_node_to_cpu() has been called on machine with non-contiguous +nodes, it returned the first node which wasn't present on machine. +Now, return code is checked and code skips over non-existing nodes to +the right one. + +Also, caching of numa_node_to_cpus_v2() result while non-zero error had +been returned was disabled. + +Signed-off-by: Petr Holasek + +Tested by Cliff Wickman (on attica.sgi.com) +--- + libnuma.c | 13 ++++++++++--- + 1 file changed, 10 insertions(+), 3 deletions(-) + +diff -up numactl-2.0.9/libnuma.c.orig numactl-2.0.9/libnuma.c +--- numactl-2.0.9/libnuma.c.orig 2013-10-08 23:34:57.000000000 +0200 ++++ numactl-2.0.9/libnuma.c 2015-07-01 15:14:44.937178134 +0200 +@@ -1380,8 +1380,12 @@ numa_node_to_cpus_v2(int node, struct bi + if (mask != buffer) + numa_bitmask_free(mask); + } else { +- node_cpu_mask_v2[node] = mask; +- } ++ /* we don't want to cache faulty result */ ++ if (!err) ++ node_cpu_mask_v2[node] = mask; ++ else ++ numa_bitmask_free(mask); ++ } + return err; + } + __asm__(".symver numa_node_to_cpus_v2,numa_node_to_cpus@@libnuma_1.2"); +@@ -1403,7 +1407,10 @@ int numa_node_of_cpu(int cpu) + bmp = numa_bitmask_alloc(ncpus); + nnodes = numa_max_node(); + for (node = 0; node <= nnodes; node++){ +- numa_node_to_cpus_v2_int(node, bmp); ++ if (numa_node_to_cpus_v2_int(node, bmp) < 0) { ++ /* It's possible for the node to not exist */ ++ continue; ++ } + if (numa_bitmask_isbitset(bmp, cpu)){ + ret = node; + goto end; diff --git a/SPECS/numactl.spec b/SPECS/numactl.spec index 9962574..b386c5d 100644 --- a/SPECS/numactl.spec +++ b/SPECS/numactl.spec @@ -1,7 +1,7 @@ Name: numactl Summary: Library for tuning for Non Uniform Memory Access machines Version: 2.0.9 -Release: 4%{?dist} +Release: 5%{?dist} # libnuma is LGPLv2 and GPLv2 # numactl binaries are GPLv2 only License: GPLv2 @@ -15,6 +15,7 @@ ExcludeArch: s390 s390x %{arm} Patch1: numactl-2.0.8-localalloc-man.patch Patch2: numactl-2.0.9-hw-detect-segfault.patch Patch3: numactl-2.0.9-mpol-bind-preferred.patch +Patch4: numactl-2.0.10-numa_node_to_cpu_skip_over_nonexisting.patch %description Simple NUMA policy support. It consists of a numactl program to run @@ -44,6 +45,7 @@ Provides development headers for numa library calls %patch1 -p1 %patch2 -p1 %patch3 -p1 +%patch4 -p1 %build make clean @@ -92,6 +94,9 @@ rm -rf $RPM_BUILD_ROOT %{_mandir}/man3/*.3* %changelog +* Wed Jul 01 2015 Petr Holasek - 2.0.9-5 +- numa_node_to_cpu skips over non-existing nodes (bz1238282) + * Mon Nov 10 2014 Petr Holasek - 2.0.9-4 - Fixed missing question mark in dist macro