Compare commits
5 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
b5085419d0 | ||
|
3a8a6c2f3d | ||
|
ea62e39e4e | ||
|
c428f7a29a | ||
|
8945713842 |
1
.cvsignore → .gitignore
vendored
1
.cvsignore → .gitignore
vendored
@ -1 +1,2 @@
|
||||
numactl-2.0.2.tar.gz
|
||||
numactl-2.0.3.tar.gz
|
21
Makefile
21
Makefile
@ -1,21 +0,0 @@
|
||||
# Makefile for source rpm: numactl
|
||||
# $Id: Makefile,v 1.1 2004/09/09 09:20:02 cvsdist Exp $
|
||||
NAME := numactl
|
||||
SPECFILE = $(firstword $(wildcard *.spec))
|
||||
|
||||
define find-makefile-common
|
||||
for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done
|
||||
endef
|
||||
|
||||
MAKEFILE_COMMON := $(shell $(find-makefile-common))
|
||||
|
||||
ifeq ($(MAKEFILE_COMMON),)
|
||||
# attempt a checkout
|
||||
define checkout-makefile-common
|
||||
test -f CVS/Root && { cvs -Q -d $$(cat CVS/Root) checkout common && echo "common/Makefile.common" ; } || { echo "ERROR: I can't figure out how to checkout the 'common' module." ; exit -1 ; } >&2
|
||||
endef
|
||||
|
||||
MAKEFILE_COMMON := $(shell $(checkout-makefile-common))
|
||||
endif
|
||||
|
||||
include $(MAKEFILE_COMMON)
|
@ -1,17 +0,0 @@
|
||||
diff -up numactl-1.0.2/syscall.c.orig numactl-1.0.2/syscall.c
|
||||
--- numactl-1.0.2/syscall.c.orig 2008-03-14 07:28:58.000000000 -0400
|
||||
+++ numactl-1.0.2/syscall.c 2008-03-14 07:29:31.000000000 -0400
|
||||
@@ -62,6 +62,13 @@
|
||||
#define __NR_set_mempolicy 261
|
||||
#define __NR_migrate_pages 258
|
||||
|
||||
+#elif defined(__alpha__)
|
||||
+
|
||||
+#define __NR_mbind 429
|
||||
+#define __NR_get_mempolicy 430
|
||||
+#define __NR_set_mempolicy 431
|
||||
+#define __NR_migrate_pages 449
|
||||
+
|
||||
#elif !defined(DEPS_RUN)
|
||||
#error "Add syscalls for your architecture or update kernel headers"
|
||||
#endif
|
@ -1,63 +0,0 @@
|
||||
diff -up numactl-1.0.2/numactl.c.orig numactl-1.0.2/numactl.c
|
||||
--- numactl-1.0.2/numactl.c.orig 2007-09-21 06:23:51.000000000 -0400
|
||||
+++ numactl-1.0.2/numactl.c 2008-04-25 09:10:05.000000000 -0400
|
||||
@@ -355,14 +355,14 @@ int main(int ac, char **av)
|
||||
break;
|
||||
case 'C': /* --physcpubind */
|
||||
{
|
||||
- int ncpus;
|
||||
+ int bufsz;
|
||||
unsigned long *cpubuf;
|
||||
dontshm("-C/--physcpubind");
|
||||
- cpubuf = cpumask(optarg, &ncpus);
|
||||
+ cpubuf = cpumask(optarg, &bufsz);
|
||||
errno = 0;
|
||||
check_cpubind(do_shm);
|
||||
did_cpubind = 1;
|
||||
- numa_sched_setaffinity(0, CPU_BYTES(ncpus), cpubuf);
|
||||
+ numa_sched_setaffinity(0, bufsz, cpubuf);
|
||||
checkerror("sched_setaffinity");
|
||||
free(cpubuf);
|
||||
break;
|
||||
diff -up numactl-1.0.2/util.h.orig numactl-1.0.2/util.h
|
||||
--- numactl-1.0.2/util.h.orig 2007-08-16 10:36:23.000000000 -0400
|
||||
+++ numactl-1.0.2/util.h 2008-04-25 09:10:05.000000000 -0400
|
||||
@@ -1,7 +1,7 @@
|
||||
extern void printmask(char *name, nodemask_t *mask);
|
||||
extern void printcpumask(char *name, unsigned long *mask, int len);
|
||||
extern nodemask_t nodemask(char *s);
|
||||
-extern unsigned long *cpumask(char *s, int *ncpus);
|
||||
+extern unsigned long *cpumask(char *s, int *bufsz);
|
||||
extern int read_sysctl(char *name);
|
||||
extern void complain(char *fmt, ...);
|
||||
extern void nerror(char *fmt, ...);
|
||||
diff -up numactl-1.0.2/util.c.orig numactl-1.0.2/util.c
|
||||
--- numactl-1.0.2/util.c.orig 2007-08-16 10:36:23.000000000 -0400
|
||||
+++ numactl-1.0.2/util.c 2008-04-25 09:10:45.000000000 -0400
|
||||
@@ -52,7 +52,7 @@ void printmask(char *name, nodemask_t *m
|
||||
int numcpus;
|
||||
|
||||
/* caller must free buffer */
|
||||
-unsigned long *cpumask(char *s, int *ncpus)
|
||||
+unsigned long *cpumask(char *s, int *bufsz)
|
||||
{
|
||||
int invert = 0;
|
||||
char *end;
|
||||
@@ -92,7 +92,7 @@ unsigned long *cpumask(char *s, int *ncp
|
||||
unsigned long arg2 = strtoul(++s, &end2, 0);
|
||||
if (end2 == s)
|
||||
complain("missing cpu argument %s\n", s);
|
||||
- if (arg > numcpus)
|
||||
+ if (arg >= numcpus)
|
||||
complain("cpu argument %d out of range\n", arg);
|
||||
while (++arg <= arg2)
|
||||
set_bit(arg, cpubuf);
|
||||
@@ -110,7 +110,7 @@ unsigned long *cpumask(char *s, int *ncp
|
||||
set_bit(i, cpubuf);
|
||||
}
|
||||
}
|
||||
- *ncpus = cpubufsize;
|
||||
+ *bufsz = cpubufsize;
|
||||
return cpubuf;
|
||||
}
|
||||
|
@ -1,36 +0,0 @@
|
||||
diff -up numactl-1.0.2/syscall.c.orig numactl-1.0.2/syscall.c
|
||||
--- numactl-1.0.2/syscall.c.orig 2007-08-16 10:36:23.000000000 -0400
|
||||
+++ numactl-1.0.2/syscall.c 2007-12-20 10:33:27.000000000 -0500
|
||||
@@ -127,7 +127,7 @@ long syscall6(long call, long a, long b,
|
||||
#endif
|
||||
|
||||
long WEAK get_mempolicy(int *policy,
|
||||
- const unsigned long *nmask, unsigned long maxnode,
|
||||
+ unsigned long *nmask, unsigned long maxnode,
|
||||
void *addr, int flags)
|
||||
{
|
||||
return syscall(__NR_get_mempolicy, policy, nmask, maxnode, addr, flags);
|
||||
diff -up numactl-1.0.2/numaint.h.orig numactl-1.0.2/numaint.h
|
||||
--- numactl-1.0.2/numaint.h.orig 2007-12-20 10:33:53.000000000 -0500
|
||||
+++ numactl-1.0.2/numaint.h 2007-12-20 10:33:58.000000000 -0500
|
||||
@@ -5,7 +5,7 @@ extern int numa_sched_setaffinity(pid_t
|
||||
extern int numa_sched_getaffinity(pid_t pid, unsigned len, const unsigned long *mask);
|
||||
extern int numa_sched_setaffinity_int(pid_t pid, unsigned len,const unsigned long *mask);
|
||||
extern int numa_sched_getaffinity_int(pid_t pid, unsigned len,const unsigned long *mask);
|
||||
-extern long get_mempolicy_int(int *policy, const unsigned long *nmask,
|
||||
+extern long get_mempolicy_int(int *policy, unsigned long *nmask,
|
||||
unsigned long maxnode, void *addr, int flags);
|
||||
extern long mbind_int(void *start, unsigned long len, int mode,
|
||||
const unsigned long *nmask, unsigned long maxnode, unsigned flags);
|
||||
diff -up numactl-1.0.2/numaif.h.orig numactl-1.0.2/numaif.h
|
||||
--- numactl-1.0.2/numaif.h.orig 2007-08-16 10:36:23.000000000 -0400
|
||||
+++ numactl-1.0.2/numaif.h 2007-12-20 10:33:27.000000000 -0500
|
||||
@@ -9,7 +9,7 @@ extern "C" {
|
||||
|
||||
/* System calls */
|
||||
extern long get_mempolicy(int *policy,
|
||||
- const unsigned long *nmask, unsigned long maxnode,
|
||||
+ unsigned long *nmask, unsigned long maxnode,
|
||||
void *addr, int flags);
|
||||
extern long mbind(void *start, unsigned long len, int mode,
|
||||
const unsigned long *nmask, unsigned long maxnode, unsigned flags);
|
@ -1,12 +0,0 @@
|
||||
diff -up numactl-2.0.2/clearcache.c.orig numactl-2.0.2/clearcache.c
|
||||
--- numactl-2.0.2/clearcache.c.orig 2008-09-29 16:08:38.000000000 -0400
|
||||
+++ numactl-2.0.2/clearcache.c 2008-09-29 16:08:49.000000000 -0400
|
||||
@@ -57,7 +57,7 @@ void clearcache(unsigned char *mem, unsi
|
||||
#if defined(__i386__) || defined(__x86_64__)
|
||||
unsigned i, cl, eax, feat;
|
||||
/* get clflush unit and feature */
|
||||
- asm("cpuid" : "=a" (eax), "=b" (cl), "=d" (feat) : "0" (1) : "cx");
|
||||
+ asm("cpuid" : "=a" (eax), "=r" (cl), "=d" (feat) : "0" (1) : "cx");
|
||||
if (!(feat & (1 << 19)))
|
||||
fallback_clearcache();
|
||||
cl = ((cl >> 8) & 0xff) * 8;
|
@ -1,13 +0,0 @@
|
||||
diff -up numactl-2.0.2/libnuma.c.orig numactl-2.0.2/libnuma.c
|
||||
--- numactl-2.0.2/libnuma.c.orig 2009-02-09 15:26:41.000000000 -0500
|
||||
+++ numactl-2.0.2/libnuma.c 2009-02-09 15:26:45.000000000 -0500
|
||||
@@ -306,9 +306,6 @@ set_configured_nodes(void)
|
||||
|
||||
d = opendir("/sys/devices/system/node");
|
||||
if (!d) {
|
||||
- numa_warn(W_nosysfs,
|
||||
- "/sys not mounted or no numa system. Assuming one node: %s",
|
||||
- strerror(errno));
|
||||
maxconfigurednode = 0;
|
||||
} else {
|
||||
while ((de = readdir(d)) != NULL) {
|
38
numactl-2.0.3-rc3-distance_parsing.patch
Normal file
38
numactl-2.0.3-rc3-distance_parsing.patch
Normal file
@ -0,0 +1,38 @@
|
||||
diff -up numactl-2.0.3-rc3/distance.c.orig numactl-2.0.3-rc3/distance.c
|
||||
--- numactl-2.0.3-rc3/distance.c.orig 2009-05-08 10:10:06.000000000 -0400
|
||||
+++ numactl-2.0.3-rc3/distance.c 2009-05-08 10:13:01.000000000 -0400
|
||||
@@ -50,6 +50,7 @@ static int read_distance_table(void)
|
||||
int numnodes = 0;
|
||||
int *table = NULL;
|
||||
int err = -1;
|
||||
+ int found_nodes = 0;
|
||||
|
||||
for (nd = 0;; nd++) {
|
||||
char fn[100];
|
||||
@@ -57,7 +58,7 @@ static int read_distance_table(void)
|
||||
sprintf(fn, "/sys/devices/system/node/node%d/distance", nd);
|
||||
dfh = fopen(fn, "r");
|
||||
if (!dfh) {
|
||||
- if (errno == ENOENT && nd > 0)
|
||||
+ if (errno == ENOENT)
|
||||
err = 0;
|
||||
if (!err && nd<numa_num_configured_nodes())
|
||||
continue;
|
||||
@@ -79,14 +80,15 @@ static int read_distance_table(void)
|
||||
}
|
||||
|
||||
parse_numbers(line, table + nd * numnodes, numnodes);
|
||||
+ found_nodes++;
|
||||
}
|
||||
free(line);
|
||||
- if (err) {
|
||||
+ if (!found_nodes) {
|
||||
numa_warn(W_distance,
|
||||
"Cannot parse distance information in sysfs: %s",
|
||||
strerror(errno));
|
||||
free(table);
|
||||
- return err;
|
||||
+ return -1;
|
||||
}
|
||||
/* Update the global table pointer. Race window here with
|
||||
other threads, but in the worst case we leak one distance
|
31
numactl-2.0.3-rc3-no-nodes-warning.patch
Normal file
31
numactl-2.0.3-rc3-no-nodes-warning.patch
Normal file
@ -0,0 +1,31 @@
|
||||
diff -up numactl-2.0.3-rc3/libnuma.c.orig numactl-2.0.3-rc3/libnuma.c
|
||||
--- numactl-2.0.3-rc3/libnuma.c.orig 2009-06-17 13:13:28.000000000 -0400
|
||||
+++ numactl-2.0.3-rc3/libnuma.c 2009-06-17 13:14:10.000000000 -0400
|
||||
@@ -1209,9 +1209,10 @@ numa_node_to_cpus_v1(int node, unsigned
|
||||
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));
|
||||
+ if (f)
|
||||
+ numa_warn(W_nosysfs2,
|
||||
+ "/sys not mounted or invalid. Assuming one node: %s",
|
||||
+ strerror(errno));
|
||||
bitmask.maskp = (unsigned long *)mask;
|
||||
bitmask.size = buflen_needed * 8;
|
||||
numa_bitmask_setall(&bitmask);
|
||||
@@ -1287,9 +1288,10 @@ numa_node_to_cpus_v2(int node, struct bi
|
||||
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));
|
||||
+ if (f)
|
||||
+ numa_warn(W_nosysfs2,
|
||||
+ "/sys not mounted or invalid. Assuming one node: %s",
|
||||
+ strerror(errno));
|
||||
numa_bitmask_setall(mask);
|
||||
err = -1;
|
||||
}
|
17
numactl.spec
17
numactl.spec
@ -1,15 +1,15 @@
|
||||
Name: numactl
|
||||
Summary: Library for tuning for Non Uniform Memory Access machines
|
||||
Version: 2.0.2
|
||||
Release: 4%{dist}
|
||||
Version: 2.0.3
|
||||
Release: 2%{dist}
|
||||
License: LGPLv2/GPLv2
|
||||
Group: System Environment/Base
|
||||
URL: ftp://oss.sgi.com/www/projects/libnuma/download
|
||||
Source0: ftp://oss.sgi.com/www/projects/libnuma/download/numactl-%{version}.tar.gz
|
||||
Buildroot: %{_tmppath}/%{name}-buildroot
|
||||
|
||||
Patch0: numactl-2.0.2-clearcache-fix.patch
|
||||
Patch1: numactl-2.0.2-remove-warning.patch
|
||||
Patch0: numactl-2.0.3-rc3-distance_parsing.patch
|
||||
Patch1: numactl-2.0.3-rc3-no-nodes-warning.patch
|
||||
|
||||
ExcludeArch: s390 s390x
|
||||
|
||||
@ -32,7 +32,7 @@ Provides development headers for numa library calls
|
||||
%patch1 -p1
|
||||
|
||||
%build
|
||||
make CFLAGS="$RPM_OPT_FLAGS -I. -fPIC"
|
||||
make CFLAGS="$RPM_OPT_FLAGS -I."
|
||||
|
||||
%install
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
@ -61,7 +61,6 @@ rm -rf $RPM_BUILD_ROOT
|
||||
%{_bindir}/memhog
|
||||
%{_bindir}/migspeed
|
||||
%{_bindir}/migratepages
|
||||
%{_mandir}/man5/*.5*
|
||||
%{_mandir}/man8/*.8*
|
||||
|
||||
%files devel
|
||||
@ -74,6 +73,12 @@ rm -rf $RPM_BUILD_ROOT
|
||||
%{_mandir}/man3/*.3*
|
||||
|
||||
%changelog
|
||||
* Mon Oct 05 2009 Neil Horman <nhorman@redhat.com> - 2.0.3-2
|
||||
- Bump release number to move it ahead of f10 (bz 526731)
|
||||
|
||||
* Mon Jun 29 2009 Neil Horman <nhorman@redhat.com> - 2.0.3-1
|
||||
- Update to latest upstream version
|
||||
|
||||
* Wed Mar 25 2009 Mark McLoughlin <markmc@redhat.com> - 2.0.2-4
|
||||
- Remove warning from libnuma (bz 484552)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user