forked from pool/numactl
This commit is contained in:
parent
5db983fa1f
commit
7222dced3f
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:79d7799ee99a0f6cb5ffdb21fc2d2581babe090c05a0cd69dc558358a31f048f
|
||||
size 57931
|
3
numactl-2.0.3-rc1.tar.bz2
Normal file
3
numactl-2.0.3-rc1.tar.bz2
Normal file
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:38fd58b669ce2b667b53c8372e8d052d99224c25689871cb315ccdb0b6772245
|
||||
size 57394
|
@ -1,163 +0,0 @@
|
||||
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; i<max; i++) {
|
||||
- if (nodemask_isset_v1(nmp, i))
|
||||
+ if (nodemask_isset_compat(nmp, i))
|
||||
numa_bitmask_setbit(bmp, i);
|
||||
}
|
||||
}
|
||||
@@ -1329,7 +1311,7 @@ numa_run_on_node_mask_v1(const nodemask_
|
||||
for (i = 0; i < NUMA_NUM_NODES; i++) {
|
||||
if (mask->n[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
|
@ -1,136 +0,0 @@
|
||||
From: Bernhard Walle <bwalle@suse.de>
|
||||
Subject: [PATCH] Fix "memset fails with 'mbind: Invalid argument'" on PPC64
|
||||
References: bnc #455977
|
||||
|
||||
Backport of
|
||||
https://bugzilla.novell.com/attachment.cgi?id=264645
|
||||
|
||||
|
||||
Signed-off-by: Bernhard Walle <bwalle@suse.de>
|
||||
|
||||
---
|
||||
libnuma.c | 56 +++++++++++++++++++++++++++++++++++++++++++++-----------
|
||||
numaint.h | 1 +
|
||||
2 files changed, 46 insertions(+), 11 deletions(-)
|
||||
|
||||
--- a/libnuma.c
|
||||
+++ b/libnuma.c
|
||||
@@ -69,12 +69,37 @@ static int maxprocnode = -1;
|
||||
static int maxproccpu = -1;
|
||||
static int nodemask_sz = 0;
|
||||
static int cpumask_sz = 0;
|
||||
+static int is_bigendian_64;
|
||||
|
||||
int numa_exit_on_error = 0;
|
||||
int numa_exit_on_warn = 0;
|
||||
static void set_sizes(void);
|
||||
|
||||
/*
|
||||
+ * return 1 if this machine is big-endian 64-bit
|
||||
+ */
|
||||
+int
|
||||
+big_endian64()
|
||||
+{
|
||||
+ union {
|
||||
+ struct {
|
||||
+ int a;
|
||||
+ int b;
|
||||
+ } ints;
|
||||
+ struct {
|
||||
+ long a;
|
||||
+ } lng;
|
||||
+ } ua;
|
||||
+ if (sizeof(long) != 8)
|
||||
+ return 0;
|
||||
+ ua.ints.a = 0;
|
||||
+ ua.ints.b = 3;
|
||||
+ if (ua.lng.a == 3)
|
||||
+ 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.
|
||||
*
|
||||
@@ -91,6 +116,7 @@ numa_init(void)
|
||||
for (i = 0; i < max; i++)
|
||||
nodemask_set_compat((nodemask_t *)&numa_all_nodes, i);
|
||||
memset(&numa_no_nodes, 0, sizeof(numa_no_nodes));
|
||||
+ is_bigendian_64 = big_endian64();
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -103,10 +129,18 @@ numa_init(void)
|
||||
static unsigned int
|
||||
_getbit(const struct bitmask *bmp, unsigned int n)
|
||||
{
|
||||
- if (n < bmp->size)
|
||||
- return (bmp->maskp[n/bitsperlong] >> (n % bitsperlong)) & 1;
|
||||
- else
|
||||
- return 0;
|
||||
+ unsigned long *ip;
|
||||
+
|
||||
+ if (n < bmp->size) {
|
||||
+ if (is_bigendian_64) {
|
||||
+ ip = bmp->maskp;
|
||||
+ return (ip[n/bitsperlong] >>
|
||||
+ (n % bitsperlong)) & 1;
|
||||
+ } else
|
||||
+ return (bmp->maskp[n/bitsperlong] >>
|
||||
+ (n % bitsperlong)) & 1;
|
||||
+ } else
|
||||
+ return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -372,10 +406,10 @@ read_mask(char *s, struct bitmask *bmp)
|
||||
{
|
||||
char *end = s;
|
||||
char *prevend;
|
||||
- unsigned int *start = (unsigned int *)bmp->maskp;
|
||||
- unsigned int *p = start;
|
||||
- unsigned int *q;
|
||||
- unsigned int i;
|
||||
+ unsigned long *start = (unsigned long *)bmp->maskp;
|
||||
+ unsigned long *p = start;
|
||||
+ unsigned long *q;
|
||||
+ unsigned long i;
|
||||
unsigned int n = 0;
|
||||
|
||||
i = strtoul(s, &end, 16);
|
||||
@@ -404,21 +438,21 @@ read_mask(char *s, struct bitmask *bmp)
|
||||
* is the highest and we put it first because we read it first.
|
||||
*/
|
||||
for (q = start + n, p = start; p < q; q--, p++) {
|
||||
- unsigned int x = *q;
|
||||
+ unsigned long x = *q;
|
||||
|
||||
*q = *p;
|
||||
*p = x;
|
||||
}
|
||||
|
||||
/* Poor mans fls() */
|
||||
- for(i = 31; i >= 0; i--)
|
||||
+ for(i = sizeof(unsigned long)*8 - 1; i >= 0; i--)
|
||||
if (test_bit(i, start + n))
|
||||
break;
|
||||
|
||||
/*
|
||||
* Return the last bit set
|
||||
*/
|
||||
- return ((sizeof(unsigned int)*8) * n) + i;
|
||||
+ return ((sizeof(unsigned long)*8) * n) + i;
|
||||
}
|
||||
|
||||
/*
|
||||
--- a/numaint.h
|
||||
+++ b/numaint.h
|
||||
@@ -32,6 +32,7 @@ enum numa_warn {
|
||||
};
|
||||
|
||||
#define howmany(x,y) (((x)+((y)-1))/(y))
|
||||
+#define bitsperint (8 * sizeof(unsigned int))
|
||||
#define bitsperlong (8 * sizeof(unsigned long))
|
||||
#define longsperbits(n) howmany(n, bitsperlong)
|
||||
#define bytesperbits(x) ((x+7)/8)
|
@ -1,3 +1,19 @@
|
||||
-------------------------------------------------------------------
|
||||
Thu Jan 15 17:36:01 CET 2009 - bwalle@suse.de
|
||||
|
||||
- Update to 2.0.3-rc1
|
||||
o Fixes to libnuma.c numa.h numacompat1.h by Daniel Gollub to fix
|
||||
v1 compatiblity
|
||||
o Fixes for 64-bit big-endian systems
|
||||
o Restore nodemask_zero() and nodemask_equal()
|
||||
o Fixes to read_mask()
|
||||
o Drops a warning message about this not being a NUMA system
|
||||
o Remove the numa_maps.5 man page (it's in Linux now)
|
||||
o Fix makefiles in tests
|
||||
o Fix off-by-ones in test mbind_mig_pages
|
||||
- Drop numactl-compat.diff: Mainline.
|
||||
- Drop numactl-fix-for-ppc64.patch: Mainline.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed Jan 14 17:13:29 CET 2009 - ro@suse.de
|
||||
|
||||
|
31
numactl.spec
31
numactl.spec
@ -1,5 +1,5 @@
|
||||
#
|
||||
# spec file for package numactl (Version 2.0.2)
|
||||
# spec file for package numactl (Version 2.0.2_2.0.3rc1)
|
||||
#
|
||||
# Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
||||
#
|
||||
@ -22,21 +22,20 @@ Url: http://oss.sgi.com/projects/libnuma/
|
||||
Name: numactl
|
||||
License: GPL v2 only; GPL v2 or later
|
||||
Summary: NUMA Policy Control
|
||||
Version: 2.0.2
|
||||
Release: 23
|
||||
Version: 2.0.2_2.0.3rc1
|
||||
Release: 1
|
||||
%define origversion 2.0.3-rc1
|
||||
AutoReqProv: on
|
||||
# bug437293
|
||||
%ifarch ppc64
|
||||
Obsoletes: numactl-64bit
|
||||
%endif
|
||||
#
|
||||
Source: numactl-%{version}.tar.bz2
|
||||
Source: numactl-%{origversion}.tar.bz2
|
||||
Group: System/Management
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
ExclusiveArch: ia64 x86_64 ppc64 ppc
|
||||
Requires: perl
|
||||
Patch0: %{name}-compat.diff
|
||||
Patch1: %{name}-fix-for-ppc64.patch
|
||||
|
||||
%description
|
||||
Control NUMA policy for individual processes. Offer libnuma for
|
||||
@ -85,11 +84,7 @@ Authors:
|
||||
Cliff Wickman (cpw@sgi.com)
|
||||
|
||||
%prep
|
||||
%setup
|
||||
%patch0 -p1
|
||||
%ifarch ppc ppc64
|
||||
%patch1 -p1
|
||||
%endif
|
||||
%setup -n %{name}-%{origversion}
|
||||
|
||||
%build
|
||||
make CFLAGS="${RPM_OPT_FLAGS}"
|
||||
@ -102,7 +97,6 @@ install -d -m 755 $RPM_BUILD_ROOT%{_libdir}
|
||||
install -d -m 755 $RPM_BUILD_ROOT/usr/include
|
||||
make prefix=${RPM_BUILD_ROOT}/usr install
|
||||
rm -f $RPM_BUILD_ROOT/%{_libdir}/lib*a
|
||||
rm -f $RPM_BUILD_ROOT/%{_mandir}/man5/numa_maps*
|
||||
|
||||
%clean
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
@ -128,6 +122,19 @@ rm -rf $RPM_BUILD_ROOT
|
||||
%{_libdir}/lib*so
|
||||
|
||||
%changelog
|
||||
* Thu Jan 15 2009 bwalle@suse.de
|
||||
- Update to 2.0.3-rc1
|
||||
o Fixes to libnuma.c numa.h numacompat1.h by Daniel Gollub to fix
|
||||
v1 compatiblity
|
||||
o Fixes for 64-bit big-endian systems
|
||||
o Restore nodemask_zero() and nodemask_equal()
|
||||
o Fixes to read_mask()
|
||||
o Drops a warning message about this not being a NUMA system
|
||||
o Remove the numa_maps.5 man page (it's in Linux now)
|
||||
o Fix makefiles in tests
|
||||
o Fix off-by-ones in test mbind_mig_pages
|
||||
- Drop numactl-compat.diff: Mainline.
|
||||
- Drop numactl-fix-for-ppc64.patch: Mainline.
|
||||
* Wed Jan 14 2009 ro@suse.de
|
||||
- baselibs.conf: really create libnuma-devel-32bit only on ppc
|
||||
* Wed Jan 14 2009 bwalle@suse.de
|
||||
|
Loading…
Reference in New Issue
Block a user