[PATCH, v2] numactl: fix libnuma on big-endian 64-bit systems

Arnd Bergmann arnd at arndb.de
Sat Dec 6 02:12:23 EST 2008


On Thursday 04 December 2008, Arnd Bergmann wrote:
> The read-mask function assumes that it is running in 32-bit mode,
> by addressing the bitmask as a series of int values, instead of
> longs. This is broken as can easily be reproduced by running numademo
> on a bit-endian 64-bit system.
> 
> Changing the addressing to use 'long' values fixes the problem.

Unfortunately, this is still wrong, as it tries recreating a kernel
data structure that is represented as a series of 'int' values, just
in a different order.

What we really need is the reverse of bitmap_scnprintf from
linux/lib/bitmap.c. I don't have access to a little-endian NUMA
machine with more than 64 CPUs, so I really don't want to send
another embarrassingly wrong patch for this.

Can anyone else try to come up with a version that handles endianess
correctly and still works on x86-64?

	Arnd <><



More information about the Linuxppc-dev mailing list