forked from pool/numactl
This commit is contained in:
parent
1c083e7156
commit
d6349fd549
@ -1,3 +0,0 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
|
||||||
oid sha256:4545b13f71a1397bdb63fe85129921360acfebb3375053950c763c43c6163d05
|
|
||||||
size 45051
|
|
3
numactl-1.0.1.tar.gz
Normal file
3
numactl-1.0.1.tar.gz
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:728adb39756843eabf04c2d54beb642a79b0e08b826c1519b793290d0f0ed4f1
|
||||||
|
size 49824
|
@ -1,26 +0,0 @@
|
|||||||
diff -urp numactl-0.9.6/libnuma.c numactl/libnuma.c
|
|
||||||
--- numactl-0.9.6/libnuma.c 2006-05-23 23:20:56.000000000 +0200
|
|
||||||
+++ numactl/libnuma.c 2006-03-28 00:17:05.000000000 +0200
|
|
||||||
@@ -493,16 +493,12 @@ int numa_node_to_cpus(int node, unsigned
|
|
||||||
|
|
||||||
/* if mask[0] is full shift left before adding another */
|
|
||||||
if (bits_in_mask_0 >= sizeof(mask[0])*8) {
|
|
||||||
- /* skip any leading zeros */
|
|
||||||
- if (prev || mask[0]){
|
|
||||||
- /* shift over any previously loaded masks */
|
|
||||||
- memmove(mask+mask_words+1, mask+mask_words,
|
|
||||||
- sizeof(mask[0]) * mask_words);
|
|
||||||
- mask_words++;
|
|
||||||
- bits_in_mask_0 = 0;
|
|
||||||
- mask[0] = 0;
|
|
||||||
- prev = 1;
|
|
||||||
- }
|
|
||||||
+ /* shift over any previously loaded masks */
|
|
||||||
+ mask_words++;
|
|
||||||
+ for (n = mask_words; n > 0; n--)
|
|
||||||
+ memmove(mask+n, mask+n-1, sizeof(mask[0]));
|
|
||||||
+ bits_in_mask_0 = 0;
|
|
||||||
+ mask[0] = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
mask[0] = (mask[0]*16) + (w - hexdigits);
|
|
@ -1,111 +0,0 @@
|
|||||||
--- numactl-0.9.8/libnuma.c 2006-04-04 05:52:26.000000000 +0200
|
|
||||||
+++ numactl/libnuma.c 2006-06-08 11:50:19.000000000 +0200
|
|
||||||
@@ -118,58 +118,26 @@
|
|
||||||
static int maxnode = -1;
|
|
||||||
static int maxcpus = -1;
|
|
||||||
|
|
||||||
-static int number_of_cpus(void)
|
|
||||||
+static int number_of_configured_cpus(void)
|
|
||||||
{
|
|
||||||
- char *line = NULL;
|
|
||||||
- size_t len = 0;
|
|
||||||
- char *s;
|
|
||||||
- FILE *f;
|
|
||||||
- int cpu;
|
|
||||||
+ int len = 16;
|
|
||||||
+ int n;
|
|
||||||
|
|
||||||
if (maxcpus >= 0)
|
|
||||||
return maxcpus + 1;
|
|
||||||
|
|
||||||
- f = fopen("/proc/cpuinfo","r");
|
|
||||||
- if (!f) {
|
|
||||||
- int n;
|
|
||||||
- int len = 8192;
|
|
||||||
- for (;;) {
|
|
||||||
- unsigned long buffer[CPU_LONGS(len)];
|
|
||||||
- memset(buffer, 0, sizeof(buffer));
|
|
||||||
- n = numa_sched_getaffinity_int(0, CPU_BYTES(len),
|
|
||||||
- buffer);
|
|
||||||
- if (n < 0 && errno == EINVAL && len < 1024*1024) {
|
|
||||||
- len *= 2;
|
|
||||||
- continue;
|
|
||||||
- }
|
|
||||||
- if (n >= 0) {
|
|
||||||
- int i, k;
|
|
||||||
- for (i = 0; i < n / sizeof(long); i++) {
|
|
||||||
- if (!buffer[i])
|
|
||||||
- continue;
|
|
||||||
- for (k = 0; k< 8; k++)
|
|
||||||
- if (buffer[i] & (1<<k))
|
|
||||||
- maxcpus = i*sizeof(long)+k;
|
|
||||||
- }
|
|
||||||
- return maxcpus;
|
|
||||||
- }
|
|
||||||
- break;
|
|
||||||
- }
|
|
||||||
- numa_warn(W_noproc, "/proc not mounted. Assuming zero nodes: %s",
|
|
||||||
- strerror(errno));
|
|
||||||
- return 0;
|
|
||||||
- }
|
|
||||||
- maxcpus = 0;
|
|
||||||
- while (getdelim(&line, &len, '\n', f) > 0) {
|
|
||||||
- if (strncmp(line,"processor",9))
|
|
||||||
+ do {
|
|
||||||
+ unsigned long buffer[CPU_LONGS(len)];
|
|
||||||
+ memset(buffer, 0, sizeof(buffer));
|
|
||||||
+ n = numa_sched_getaffinity_int(0, CPU_BYTES(len), buffer);
|
|
||||||
+ if (n < 0 && errno == EINVAL) {
|
|
||||||
+ if (len >= 1024*1024)
|
|
||||||
+ break;
|
|
||||||
+ len *= 2;
|
|
||||||
continue;
|
|
||||||
- s = line + strcspn(line, "0123456789");
|
|
||||||
- if (sscanf(s, "%d", &cpu) == 1 && cpu > maxcpus)
|
|
||||||
- maxcpus = cpu;
|
|
||||||
- }
|
|
||||||
- free(line);
|
|
||||||
- fclose(f);
|
|
||||||
- return maxcpus + 1;
|
|
||||||
+ }
|
|
||||||
+ } while (n < 0);
|
|
||||||
+ return len;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int fallback_max_node(void)
|
|
||||||
@@ -440,7 +408,7 @@
|
|
||||||
int n;
|
|
||||||
int buflen_needed;
|
|
||||||
unsigned long *mask, prev;
|
|
||||||
- int ncpus = number_of_cpus();
|
|
||||||
+ int ncpus = number_of_configured_cpus();
|
|
||||||
int i;
|
|
||||||
int mask_words;
|
|
||||||
int bits_in_mask_0;
|
|
||||||
@@ -528,7 +496,7 @@
|
|
||||||
|
|
||||||
int numa_run_on_node_mask(const nodemask_t *mask)
|
|
||||||
{
|
|
||||||
- int ncpus = number_of_cpus();
|
|
||||||
+ int ncpus = number_of_configured_cpus();
|
|
||||||
int i, k, err;
|
|
||||||
unsigned long cpus[CPU_LONGS(ncpus)], nodecpus[CPU_LONGS(ncpus)];
|
|
||||||
memset(cpus, 0, CPU_BYTES(ncpus));
|
|
||||||
@@ -582,7 +550,7 @@
|
|
||||||
|
|
||||||
nodemask_t numa_get_run_node_mask(void)
|
|
||||||
{
|
|
||||||
- int ncpus = number_of_cpus();
|
|
||||||
+ int ncpus = number_of_configured_cpus();
|
|
||||||
nodemask_t mask;
|
|
||||||
int i, k;
|
|
||||||
int max = numa_max_node_int();
|
|
||||||
@@ -612,7 +580,7 @@
|
|
||||||
|
|
||||||
int numa_run_on_node(int node)
|
|
||||||
{
|
|
||||||
- int ncpus = number_of_cpus();
|
|
||||||
+ int ncpus = number_of_configured_cpus();
|
|
||||||
unsigned long cpus[CPU_LONGS(ncpus)];
|
|
||||||
|
|
||||||
if (node == -1)
|
|
@ -1,20 +0,0 @@
|
|||||||
--- numactl/libnuma.c~ 2006-06-08 11:50:19.000000000 +0200
|
|
||||||
+++ numactl/libnuma.c 2006-06-08 16:57:12.000000000 +0200
|
|
||||||
@@ -122,7 +122,8 @@
|
|
||||||
{
|
|
||||||
int len = 16;
|
|
||||||
int n;
|
|
||||||
-
|
|
||||||
+ int olde = errno;
|
|
||||||
+
|
|
||||||
if (maxcpus >= 0)
|
|
||||||
return maxcpus + 1;
|
|
||||||
|
|
||||||
@@ -137,6 +138,7 @@
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
} while (n < 0);
|
|
||||||
+ errno = olde;
|
|
||||||
return len;
|
|
||||||
}
|
|
||||||
|
|
25
numactl-zero
25
numactl-zero
@ -1,25 +0,0 @@
|
|||||||
diff -Naurp numactl-0.9.6/libnuma.c numactl-0.9.6-fix/libnuma.c
|
|
||||||
--- numactl-0.9.6/libnuma.c 2006-03-28 03:28:09.000000000 -0500
|
|
||||||
+++ numactl-0.9.6-fix/libnuma.c 2006-03-30 11:23:33.000000000 -0500
|
|
||||||
@@ -491,12 +491,17 @@ int numa_node_to_cpus(int node, unsigned
|
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
|
|
||||||
+ /* skip any leading zeros */
|
|
||||||
+ if (!prev && !(w - hexdigits))
|
|
||||||
+ continue;
|
|
||||||
+ prev = 1;
|
|
||||||
+
|
|
||||||
/* if mask[0] is full shift left before adding another */
|
|
||||||
if (bits_in_mask_0 >= sizeof(mask[0])*8) {
|
|
||||||
/* shift over any previously loaded masks */
|
|
||||||
+ memmove(mask+mask_words+1, mask+mask_words,
|
|
||||||
+ sizeof(mask[0]) * mask_words);
|
|
||||||
mask_words++;
|
|
||||||
- for (n = mask_words; n > 0; n--)
|
|
||||||
- memmove(mask+n, mask+n-1, sizeof(mask[0]));
|
|
||||||
bits_in_mask_0 = 0;
|
|
||||||
mask[0] = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -1,33 +0,0 @@
|
|||||||
diff -Naurp numactl-0.9.7-orig/libnuma.c numactl-0.9.7-fix/libnuma.c
|
|
||||||
--- numactl-0.9.7-orig/libnuma.c 2006-03-30 12:27:29.000000000 -0500
|
|
||||||
+++ numactl-0.9.7-fix/libnuma.c 2006-03-30 16:31:13.000000000 -0500
|
|
||||||
@@ -491,19 +491,18 @@ int numa_node_to_cpus(int node, unsigned
|
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
|
|
||||||
- /* skip any leading zeros */
|
|
||||||
- if (!prev && !(w - hexdigits))
|
|
||||||
- continue;
|
|
||||||
- prev = 1;
|
|
||||||
-
|
|
||||||
/* if mask[0] is full shift left before adding another */
|
|
||||||
if (bits_in_mask_0 >= sizeof(mask[0])*8) {
|
|
||||||
- /* shift over any previously loaded masks */
|
|
||||||
- memmove(mask+mask_words+1, mask+mask_words,
|
|
||||||
- sizeof(mask[0]) * mask_words);
|
|
||||||
- mask_words++;
|
|
||||||
- bits_in_mask_0 = 0;
|
|
||||||
- mask[0] = 0;
|
|
||||||
+ /* skip any leading zeros */
|
|
||||||
+ if (prev || mask[0]){
|
|
||||||
+ /* shift over any previously loaded masks */
|
|
||||||
+ memmove(mask+mask_words+1, mask+mask_words,
|
|
||||||
+ sizeof(mask[0]) * mask_words);
|
|
||||||
+ mask_words++;
|
|
||||||
+ bits_in_mask_0 = 0;
|
|
||||||
+ mask[0] = 0;
|
|
||||||
+ prev = 1;
|
|
||||||
+ }
|
|
||||||
}
|
|
||||||
|
|
||||||
mask[0] = (mask[0]*16) + (w - hexdigits);
|
|
@ -1,3 +1,10 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Thu Aug 16 01:33:42 CEST 2007 - ak@suse.de
|
||||||
|
|
||||||
|
- Update to 1.0.1
|
||||||
|
* Only bug fixes since the previous version, no
|
||||||
|
new functionality.
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Thu Jun 8 17:04:54 CEST 2006 - ak@suse.de
|
Thu Jun 8 17:04:54 CEST 2006 - ak@suse.de
|
||||||
|
|
||||||
|
27
numactl.spec
27
numactl.spec
@ -1,7 +1,7 @@
|
|||||||
#
|
#
|
||||||
# spec file for package numactl (Version 0.9.6)
|
# spec file for package numactl (Version 1.0.1)
|
||||||
#
|
#
|
||||||
# Copyright (c) 2006 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
# Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
||||||
# This file and all modifications and additions to the pristine
|
# This file and all modifications and additions to the pristine
|
||||||
# package are under the same license as the package itself.
|
# package are under the same license as the package itself.
|
||||||
#
|
#
|
||||||
@ -11,17 +11,12 @@
|
|||||||
# norootforbuild
|
# norootforbuild
|
||||||
|
|
||||||
Name: numactl
|
Name: numactl
|
||||||
License: GPL
|
License: GPL v2 or later
|
||||||
Summary: NUMA Policy Control
|
Summary: NUMA Policy Control
|
||||||
Version: 0.9.6
|
Version: 1.0.1
|
||||||
Release: 5
|
Release: 1
|
||||||
Autoreqprov: on
|
Autoreqprov: on
|
||||||
Source: numactl-%version.tar.gz
|
Source: numactl-%version.tar.gz
|
||||||
Patch0: numactl-zero
|
|
||||||
Patch1: numactl-zero-fix
|
|
||||||
Patch2: numactl-node-to-cpus
|
|
||||||
Patch3: numactl-number-of-cpus
|
|
||||||
Patch4: numactl-save-errno
|
|
||||||
Group: System/Management
|
Group: System/Management
|
||||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||||
ExclusiveArch: ia64 x86_64 ppc64 ppc
|
ExclusiveArch: ia64 x86_64 ppc64 ppc
|
||||||
@ -39,18 +34,12 @@ Authors:
|
|||||||
|
|
||||||
%prep
|
%prep
|
||||||
%setup
|
%setup
|
||||||
%patch0 -p1
|
|
||||||
%patch1 -p1
|
|
||||||
%patch2 -p1
|
|
||||||
%patch3 -p1
|
|
||||||
%patch4 -p1
|
|
||||||
|
|
||||||
%build
|
%build
|
||||||
make CFLAGS="${RPM_OPT_FLAGS}"
|
make CFLAGS="${RPM_OPT_FLAGS}"
|
||||||
|
|
||||||
%install
|
%install
|
||||||
rm -rf $RPM_BUILD_ROOT
|
rm -rf $RPM_BUILD_ROOT
|
||||||
mkdir -p $RPM_BUILD_ROOT/usr/share/man/man2
|
|
||||||
install -d -m 755 $RPM_BUILD_ROOT/usr/bin
|
install -d -m 755 $RPM_BUILD_ROOT/usr/bin
|
||||||
install -d -m 755 $RPM_BUILD_ROOT%{_mandir}/man8
|
install -d -m 755 $RPM_BUILD_ROOT%{_mandir}/man8
|
||||||
install -d -m 755 $RPM_BUILD_ROOT%{_mandir}/man3
|
install -d -m 755 $RPM_BUILD_ROOT%{_mandir}/man3
|
||||||
@ -71,7 +60,11 @@ rm -rf $RPM_BUILD_ROOT
|
|||||||
%{_libdir}/lib*
|
%{_libdir}/lib*
|
||||||
/usr/include/*
|
/usr/include/*
|
||||||
|
|
||||||
%changelog -n numactl
|
%changelog
|
||||||
|
* Thu Aug 16 2007 - ak@suse.de
|
||||||
|
- Update to 1.0.1
|
||||||
|
* Only bug fixes since the previous version, no
|
||||||
|
new functionality.
|
||||||
* Thu Jun 08 2006 - ak@suse.de
|
* Thu Jun 08 2006 - ak@suse.de
|
||||||
- Save/restore errno correctly (#182158)
|
- Save/restore errno correctly (#182158)
|
||||||
* Thu Jun 08 2006 - ak@suse.de
|
* Thu Jun 08 2006 - ak@suse.de
|
||||||
|
Loading…
Reference in New Issue
Block a user