From d704efec15479daadd9b8c86eef6888f2c16b4bb81a9f837a1770b4c5f023201 Mon Sep 17 00:00:00 2001 From: OBS User unknown Date: Thu, 20 Nov 2008 14:57:38 +0000 Subject: [PATCH] OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/numactl?expand=0&rev=7 --- numactl-compat.diff | 163 ++++++++++++++++++++++++++++++++++++++++++++ numactl.changes | 6 ++ numactl.spec | 13 ++-- 3 files changed, 178 insertions(+), 4 deletions(-) create mode 100644 numactl-compat.diff diff --git a/numactl-compat.diff b/numactl-compat.diff new file mode 100644 index 0000000..c471a4b --- /dev/null +++ b/numactl-compat.diff @@ -0,0 +1,163 @@ +diff -Nurp numactl-2.0.2/CHANGES numactl-2.0.3-rc1/CHANGES +--- numactl-2.0.2/CHANGES 2008-08-05 16:36:58.000000000 +0200 ++++ numactl-2.0.3-rc1/CHANGES 2008-11-20 00:54:06.000000000 +0100 +@@ -269,3 +269,6 @@ updating in newer kernels (Mel Gorman) + - Fix numaif.h and numaint.h (migrate_pages; from Masatake Yamato) + - Fixes to numademo (min/max, and array index; from Kent Liu) + - Fixes to Makefile and permissions; from Berhard Walle ++ ++2.0.3-rc1 ++- Fixes to libnuma.c numa.h numacompat1.h by Daniel Rahn to fix v1 compatiblity +diff -Nurp numactl-2.0.2/libnuma.c numactl-2.0.3-rc1/libnuma.c +--- numactl-2.0.2/libnuma.c 2008-08-05 16:36:58.000000000 +0200 ++++ numactl-2.0.3-rc1/libnuma.c 2008-11-20 00:54:06.000000000 +0100 +@@ -74,24 +74,6 @@ int numa_exit_on_error = 0; + int numa_exit_on_warn = 0; + static void set_sizes(void); + +-static inline void +-nodemask_set_v1(nodemask_t *mask, int node) +-{ +- mask->n[node / (8*sizeof(unsigned long))] |= +- (1UL<<(node%(8*sizeof(unsigned long)))); +-} +- +-static inline int +-nodemask_isset_v1(const nodemask_t *mask, int node) +-{ +- if ((unsigned)node >= NUMA_NUM_NODES) +- return 0; +- if (mask->n[node / (8*sizeof(unsigned long))] & +- (1UL<<(node%(8*sizeof(unsigned long))))) +- return 1; +- return 0; +-} +- + /* + * There are two special functions, _init(void) and _fini(void), which + * are called automatically by the dynamic loader whenever a library is loaded. +@@ -107,7 +89,7 @@ numa_init(void) + /* numa_all_nodes should represent existing nodes on this system */ + max = numa_num_configured_nodes(); + for (i = 0; i < max; i++) +- nodemask_set_v1((nodemask_t *)&numa_all_nodes, i); ++ nodemask_set_compat((nodemask_t *)&numa_all_nodes, i); + memset(&numa_no_nodes, 0, sizeof(numa_no_nodes)); + } + +@@ -509,7 +491,7 @@ set_thread_constraints(void) + static void + set_numa_max_cpu(void) + { +- int len = 2048; ++ int len = 4096; + int n; + int olde = errno; + struct bitmask *buffer; +@@ -995,7 +977,7 @@ copy_bitmask_to_nodemask(struct bitmask + if (i >= max) + break; + if (numa_bitmask_isbitset(bmp, i)) +- nodemask_set_v1((nodemask_t *)nmp, i); ++ nodemask_set_compat((nodemask_t *)nmp, i); + } + } + +@@ -1034,7 +1016,7 @@ copy_nodemask_to_bitmask(nodemask_t *nmp + if (max > bmp->size) + max = bmp->size; + for (i=0; in[i / BITS_PER_LONG] == 0) + continue; +- if (nodemask_isset_v1(mask, i)) { ++ if (nodemask_isset_compat(mask, i)) { + if (numa_node_to_cpus_v1_int(i, nodecpus, CPU_BYTES(ncpus)) < 0) { + numa_warn(W_noderunmask, + "Cannot read node cpumask from sysfs"); +diff -Nurp numactl-2.0.2/numacompat1.h numactl-2.0.3-rc1/numacompat1.h +--- numactl-2.0.2/numacompat1.h 2008-08-05 16:36:58.000000000 +0200 ++++ numactl-2.0.3-rc1/numacompat1.h 2008-11-20 00:54:06.000000000 +0100 +@@ -11,3 +11,8 @@ + #define numa_sched_getaffinity(p,l,m) numa_sched_getaffinity_compat(p,l,m) + #define numa_sched_setaffinity(p,l,m) numa_sched_setaffinity_compat(p,l,m) + #define numa_node_to_cpus(n,b,bl) numa_node_to_cpus_compat(n,b,bl) ++#define nodemask_zero(m) nodemask_zero_compat(m) ++#define nodemask_set(m, n) nodemask_set_compat(m, n) ++#define nodemask_clr(m, n) nodemask_clr_compat(m, n) ++#define nodemask_isset(m, n) nodemask_isset_compat(m, n) ++#define nodemask_equal(a, b) nodemask_equal_compat(a, b) +diff -Nurp numactl-2.0.2/numa.h numactl-2.0.3-rc1/numa.h +--- numactl-2.0.2/numa.h 2008-08-05 16:36:58.000000000 +0200 ++++ numactl-2.0.3-rc1/numa.h 2008-11-20 00:54:06.000000000 +0100 +@@ -61,14 +61,48 @@ void copy_bitmask_to_nodemask(struct bit + void copy_bitmask_to_bitmask(struct bitmask *, struct bitmask *); + + /* compatibility for codes that used them: */ +-static inline void nodemask_zero(struct bitmask *mask) ++static inline void nodemask_zero_compat(nodemask_t *mask) + { +- numa_bitmask_clearall(mask); ++ struct bitmask tmp; ++ ++ tmp.maskp = (unsigned long *)mask; ++ tmp.size = sizeof(nodemask_t) * 8; ++ numa_bitmask_clearall(&tmp); + } + +-static inline int nodemask_equal(struct bitmask *a, struct bitmask *b) ++static inline void nodemask_set_compat(nodemask_t *mask, int node) ++{ ++ mask->n[node / (8*sizeof(unsigned long))] |= ++ (1UL<<(node%(8*sizeof(unsigned long)))); ++} ++ ++static inline void nodemask_clr_compat(nodemask_t *mask, int node) ++{ ++ mask->n[node / (8*sizeof(unsigned long))] &= ++ ~(1UL<<(node%(8*sizeof(unsigned long)))); ++} ++ ++static inline int nodemask_isset_compat(const nodemask_t *mask, int node) ++{ ++ if ((unsigned)node >= NUMA_NUM_NODES) ++ return 0; ++ if (mask->n[node / (8*sizeof(unsigned long))] & ++ (1UL<<(node%(8*sizeof(unsigned long))))) ++ return 1; ++ return 0; ++} ++ ++static inline int nodemask_equal_compat(const nodemask_t *a, const nodemask_t *b) + { +- return numa_bitmask_equal(a, b); ++ struct bitmask tmp_a, tmp_b; ++ ++ tmp_a.maskp = (unsigned long *)a; ++ tmp_a.size = sizeof(nodemask_t) * 8; ++ ++ tmp_b.maskp = (unsigned long *)b; ++ tmp_b.size = sizeof(nodemask_t) * 8; ++ ++ return numa_bitmask_equal(&tmp_a, &tmp_b); + } + + /* NUMA support available. If this returns a negative value all other function +diff -Nurp numactl-2.0.2/README numactl-2.0.3-rc1/README +--- numactl-2.0.2/README 2008-08-05 16:36:58.000000000 +0200 ++++ numactl-2.0.3-rc1/README 2008-11-20 00:54:06.000000000 +0100 +@@ -31,7 +31,7 @@ you might need to pay attention there or + It also uses a public domain Mersenne Twister implementation from + Michael Brundage. + +-Version 2.0.0: (C) 2008 SGI ++Version 2.0.3-rc1: (C) 2008 SGI + + Author: + Andi Kleen, SUSE Labs diff --git a/numactl.changes b/numactl.changes index 771bba6..c60c990 100644 --- a/numactl.changes +++ b/numactl.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Thu Nov 20 11:58:59 CET 2008 - bwalle@suse.de + +- Fixes to libnuma.c numa.h numacompat1.h by Daniel Gollub to fix + v1 compatiblity (bnc#441440). + ------------------------------------------------------------------- Tue Aug 05 15:50:11 CEST 2008 - bwalle@suse.de diff --git a/numactl.spec b/numactl.spec index 005a380..30605ec 100644 --- a/numactl.spec +++ b/numactl.spec @@ -23,13 +23,14 @@ Name: numactl License: GPL v2 only; GPL v2 or later Summary: NUMA Policy Control Version: 2.0.2 -Release: 1 +Release: 16 AutoReqProv: on Source: numactl-%{version}.tar.bz2 Group: System/Management BuildRoot: %{_tmppath}/%{name}-%{version}-build ExclusiveArch: ia64 x86_64 ppc64 ppc Requires: perl +Patch0: numactl-compat.diff %description Control NUMA policy for individual processes. Offer libnuma for @@ -79,6 +80,7 @@ Authors: %prep %setup +%patch0 -p1 %build make CFLAGS="${RPM_OPT_FLAGS}" @@ -118,6 +120,9 @@ rm -rf $RPM_BUILD_ROOT %{_libdir}/lib*so %changelog +* Thu Nov 20 2008 bwalle@suse.de +- Fixes to libnuma.c numa.h numacompat1.h by Daniel Gollub to fix + v1 compatiblity (bnc#441440). * Tue Aug 05 2008 bwalle@suse.de - update to 2.0.2 o Various numademo improvements: @@ -194,7 +199,7 @@ rm -rf $RPM_BUILD_ROOT - Save/restore errno correctly (#182158) * Thu Jun 08 2006 ak@suse.de - Fix cpu buffer sizing for affinity syscalls (#182145) -* Wed May 24 2006 ak@suse.de +* Tue May 23 2006 ak@suse.de - Fix cpumap parsing again (#177749) * Thu Mar 30 2006 ak@suse.de - Fix the cpumap parsing fix to not corrupt memory (still #161089) @@ -208,7 +213,7 @@ rm -rf $RPM_BUILD_ROOT * Thu Mar 23 2006 ak@suse.de - Don't install syscall manpages which are in the normal manpages now (#158550) -* Mon Feb 13 2006 ak@suse.de +* Sun Feb 12 2006 ak@suse.de - Install migratepages manpage (followon for #143825) * Wed Feb 08 2006 ak@suse.de - Add support for page migration (#143825) @@ -222,7 +227,7 @@ rm -rf $RPM_BUILD_ROOT - Update to numactl 0.8 * Fri Dec 16 2005 ro@suse.de - do not build as root -* Tue Oct 11 2005 ak@suse.de +* Mon Oct 10 2005 ak@suse.de - use RPM_OPT_FLAGS - fix build on ia64 with debuginfo package * Mon Oct 10 2005 ak@suse.de