Hi Jan,
On 2022/9/27 17:39, Jan Beulich wrote:
It's the comment which is wrong - it wasn't updated in Linux commit
54413927f022 ("x86-64: x86_64-make-the-numa-hash-function-nodemap-allocation
fix fix"). Our code was cloned from Linux'es. In fact when memory is not
contiguous, too small a shift value might be determined. This in particular
also may matter for the lowest range covered by any node: On x86 this will
always start at zero (and hence won't influence the final calculation), but
iirc on Arm memory may (and typically will) start at non-zero addresses. In
such a case the first node's start address should be ignored, as it's fine
to (kind of) associate all lower addresses (where no memory is) with this
same node. But that's now indeed something which will want taking care of
while making the code usable for other architectures
Sorry, I hadn't read this before my last reply. I think I kind of
understand what you mean now. If we do not ignore the lowest memory
start address in the node, then the shift we calculate may contain a
part of non-ram physical addresses. But if we ignore it, which address
should we start from? Counting from end may ignore most of the ram area
on this node.
Cheers,
Wei Chen