Mailinglist Archive: opensuse-commit (1028 mails)

< Previous Next >
commit numactl
  • From: root@xxxxxxx (h_root)
  • Date: Thu, 8 Jun 2006 15:15:41 +0200 (CEST)
  • Message-id: <20060608131541.EC2AC5227@xxxxxxxxxxxxxxx>

Hello community,

here is the log from the commit of package numactl
checked in at Thu Jun 8 15:15:41 CEST 2006.

--------
--- arch/x86_64/numactl/numactl.changes 2006-05-23 23:36:57.000000000 +0200
+++ numactl/numactl.changes 2006-06-08 12:24:45.000000000 +0200
@@ -1,0 +2,5 @@
+Thu Jun 8 11:59:32 CEST 2006 - ak@xxxxxxx
+
+- Fix cpu buffer sizing for affinity syscalls (#182145)
+
+-------------------------------------------------------------------

New:
----
numactl-number-of-cpus

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ numactl.spec ++++++
--- /var/tmp/diff_new_pack.2QvKzR/_old 2006-06-08 15:13:51.000000000 +0200
+++ /var/tmp/diff_new_pack.2QvKzR/_new 2006-06-08 15:13:51.000000000 +0200
@@ -14,12 +14,13 @@
License: GPL
Summary: NUMA Policy Control
Version: 0.9.6
-Release: 3
+Release: 4
Autoreqprov: on
Source: numactl-%version.tar.gz
Patch0: numactl-zero
Patch1: numactl-zero-fix
Patch2: numactl-node-to-cpus
+Patch3: numactl-number-of-cpus
Group: System/Management
BuildRoot: %{_tmppath}/%{name}-%{version}-build
ExclusiveArch: ia64 x86_64 ppc64 ppc
@@ -40,6 +41,7 @@
%patch0 -p1
%patch1 -p1
%patch2 -p1
+%patch3 -p1

%build
make CFLAGS="${RPM_OPT_FLAGS}"
@@ -68,6 +70,8 @@
/usr/include/*

%changelog -n numactl
+* Thu Jun 08 2006 - ak@xxxxxxx
+- Fix cpu buffer sizing for affinity syscalls (#182145)
* Tue May 23 2006 - ak@xxxxxxx
- Fix cpumap parsing again (#177749)
* Thu Mar 30 2006 - ak@xxxxxxx

++++++ numactl-number-of-cpus ++++++
--- 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 * 8;
}

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)

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++



Remember to have fun...


---------------------------------------------------------------------
To unsubscribe, e-mail: opensuse-commit-unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse-commit-help@xxxxxxxxxxxx

< Previous Next >
This Thread