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

From: Arnd Bergmann <[email-masked]>
Date: Fri, 5 Dec 2008 16:12:23 +0100

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 <><