[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <201005071445.50147.arnd@arndb.de>
Date: Fri, 7 May 2010 14:45:49 +0200
From: Arnd Bergmann <arnd@...db.de>
To: linux-kernel@...r.kernel.org
Cc: stable@...nel.org, Rusty Russell <rusty@...tcorp.com.au>,
Andi Kleen <andi@...stfloor.org>,
Ken Werner <ken.werner@....de>
Subject: cpumask: fix compat getaffinity
Commit a45185d2d "cpumask: convert kernel/compat.c" broke
libnuma, which abuses sched_getaffinity to find out NR_CPUS
in order to parse /sys/devices/system/node/node*/cpumap.
On NUMA systems with less than 32 possibly CPUs, the
current compat_sys_sched_getaffinity now returns '4'
instead of the actual NR_CPUS/8, which makes libnuma
bail out when parsing the cpumap.
This restores the original return value for now.
If we ever get around to changing cpumask_size
to return only possibly CPUs, we will also need to
make the format of the cpumap file.
We should probably also make libnuma able to deal with
the modified kernel interface, so it can operate on
all kernels.
Signed-off-by: Arnd Bergmann <arnd@...db.de>
Reported-by: Ken Werner <ken.werner@....de>
Cc: stable@...nel.org
Cc: Andi Kleen <andi@...stfloor.org>
--- a/kernel/compat.c
+++ b/kernel/compat.c
@@ -497,7 +497,7 @@ asmlinkage long compat_sys_sched_getaffinity(compat_pid_t pid, unsigned int len,
unsigned long *k;
unsigned int min_length = cpumask_size();
- if (nr_cpu_ids <= BITS_PER_COMPAT_LONG)
+ if (NR_CPUS <= BITS_PER_COMPAT_LONG)
min_length = sizeof(compat_ulong_t);
if (len < min_length)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists