diff --git a/SOURCES/numactl-2.0.11-libnuma-supress-warnings-for-non-existing-node.patch b/SOURCES/numactl-2.0.11-libnuma-supress-warnings-for-non-existing-node.patch new file mode 100644 index 0000000..57c85ba --- /dev/null +++ b/SOURCES/numactl-2.0.11-libnuma-supress-warnings-for-non-existing-node.patch @@ -0,0 +1,60 @@ +From a69169698c4c086b7a74602938b329fb055fdf60 Mon Sep 17 00:00:00 2001 +From: Petr Holasek +Date: Mon, 7 Dec 2015 15:32:29 +0100 +Subject: [PATCH] libnuma: supress warnings for non-existing node + +When calling numa_node_to_cpus on non-existing node number (e.g. for +non-contiguous node numbers), a bit confusing warning is supressed. Since +warnings are implemented as weak functions they cannot be overriden when +using dlsym interface. + +Signed-off-by: Petr Holasek +--- + libnuma.c | 24 ++++++++++++++---------- + 1 file changed, 14 insertions(+), 10 deletions(-) + +diff --git a/libnuma.c b/libnuma.c +index 3717d5b..549525c 100644 +--- a/libnuma.c ++++ b/libnuma.c +@@ -1276,11 +1276,13 @@ numa_node_to_cpus_v1(int node, unsigned long *buffer, int bufferlen) + sprintf(fn, "/sys/devices/system/node/node%d/cpumap", node); + f = fopen(fn, "r"); + if (!f || getdelim(&line, &len, '\n', f) < 1) { +- numa_warn(W_nosysfs2, +- "/sys not mounted or invalid. Assuming one node: %s", +- strerror(errno)); +- numa_warn(W_nosysfs2, +- "(cannot open or correctly parse %s)", fn); ++ if (numa_bitmask_isbitset(numa_nodes_ptr, node)) { ++ numa_warn(W_nosysfs2, ++ "/sys not mounted or invalid. Assuming one node: %s", ++ strerror(errno)); ++ numa_warn(W_nosysfs2, ++ "(cannot open or correctly parse %s)", fn); ++ } + bitmask.maskp = (unsigned long *)mask; + bitmask.size = buflen_needed * 8; + numa_bitmask_setall(&bitmask); +@@ -1355,11 +1357,13 @@ numa_node_to_cpus_v2(int node, struct bitmask *buffer) + sprintf(fn, "/sys/devices/system/node/node%d/cpumap", node); + f = fopen(fn, "r"); + if (!f || getdelim(&line, &len, '\n', f) < 1) { +- numa_warn(W_nosysfs2, +- "/sys not mounted or invalid. Assuming one node: %s", +- strerror(errno)); +- numa_warn(W_nosysfs2, +- "(cannot open or correctly parse %s)", fn); ++ if (numa_bitmask_isbitset(numa_nodes_ptr, node)) { ++ numa_warn(W_nosysfs2, ++ "/sys not mounted or invalid. Assuming one node: %s", ++ strerror(errno)); ++ numa_warn(W_nosysfs2, ++ "(cannot open or correctly parse %s)", fn); ++ } + numa_bitmask_setall(mask); + err = -1; + } +-- +2.4.3 + diff --git a/SPECS/numactl.spec b/SPECS/numactl.spec index b386c5d..c6f9c5b 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: 5%{?dist} +Release: 6%{?dist} # libnuma is LGPLv2 and GPLv2 # numactl binaries are GPLv2 only License: GPLv2 @@ -16,6 +16,7 @@ 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 +Patch5: numactl-2.0.11-libnuma-supress-warnings-for-non-existing-node.patch %description Simple NUMA policy support. It consists of a numactl program to run @@ -46,6 +47,7 @@ Provides development headers for numa library calls %patch2 -p1 %patch3 -p1 %patch4 -p1 +%patch5 -p1 %build make clean @@ -94,8 +96,11 @@ rm -rf $RPM_BUILD_ROOT %{_mandir}/man3/*.3* %changelog +* Mon Dec 14 2015 Petr Holasek - 2.0.9-6 +- confusing warning supressed (bz1270734) + * Wed Jul 01 2015 Petr Holasek - 2.0.9-5 -- numa_node_to_cpu skips over non-existing nodes (bz1238282) +- numa_node_to_cpu skips over non-existing nodes (bz1180415) * Mon Nov 10 2014 Petr Holasek - 2.0.9-4 - Fixed missing question mark in dist macro