Package: libnuma1
Version: 2.0.3~rc1-1
Severity: important

Hello,

After upgrading a quad-socket quad-core machine from a custom 2.6.27
to Debian's 2.6.29, we were amazed to see that numactl now reports that
--physcpubind=X is an out-of-range CPU when 12<=X<16 (while obviously
we still have 16 cores in this machine). Same problem on other machines
with 2.6.29: the last 4 cores are out-of-range.

It appears that this is caused by set_thread_constraints() passing a
wrong pointer to read_mask() when trying to gather maxproccpu and
maxprocnode from /proc/self/status. It points to the second character
of the mask instead of the first one, thus loosing one "f", which means
4 cores are lost.

The kernel code generating the "Cpus_allowed:" and "Mems_allowed:" masks
in /proc/self/status has  changed recently, so maybe the formatting
changed a bit (whitespaces?).
The patch below fixes this problem by just passing a pointer to the first
character after ":" instead of trying to guess howmany whitespaces follow,
since read_mask/strtoul are able to skip whitespaces anyway.

By the way, I think it would be better to parse
/sys/devices/system/node/node*/cpumap
instead of some lines of /proc/self/status...

Signed-off-by: Brice Goglin <[email protected]>

diff -ur numactl-2.0.3~rc1/libnuma.c numactl-2.0.3~rc1.save/libnuma.c
--- numactl-2.0.3~rc1/libnuma.c 2008-12-09 20:38:07.000000000 +0100
+++ numactl-2.0.3~rc1.save/libnuma.c    2009-04-21 15:44:19.000000000 +0200
@@ -479,11 +479,11 @@
 
        while (getline(&buffer, &buflen, f) > 0) {
                if (strncmp(buffer,"Cpus_allowed:",13) == 0)
-                       maxproccpu = read_mask(buffer + 15, numa_all_cpus_ptr);
+                       maxproccpu = read_mask(buffer + 13, numa_all_cpus_ptr);
 
                if (strncmp(buffer,"Mems_allowed:",13) == 0) {
                        maxprocnode =
-                               read_mask(buffer + 15, numa_all_nodes_ptr);
+                               read_mask(buffer + 13, numa_all_nodes_ptr);
                }
        }
        fclose(f);


-- System Information:
Debian Release: squeeze/sid
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'unstable'), (500, 'stable'), (1, 
'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.29-1-amd64 (SMP w/16 CPU cores)
Locale: LANG=C, lc_ctype=fr...@euro (charmap=ISO-8859-15)
Shell: /bin/sh linked to /bin/bash

Versions of packages libnuma1 depends on:
ii  libc6                         2.9-4      GNU C Library: Shared libraries

libnuma1 recommends no packages.

libnuma1 suggests no packages.

-- no debconf information



-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to