mm: only display online cpus of the numa node
authorZhen Lei <[email protected]>
Fri, 13 Oct 2017 22:57:50 +0000 (15:57 -0700)
committerLinus Torvalds <[email protected]>
Fri, 13 Oct 2017 23:18:32 +0000 (16:18 -0700)
commit064f0e9302af4f4ab5e9dca03a5a77d6bebfd35e
treef1656e508962b88eda1ebf0d4679676c9eba5de5
parentaf0db981f35ea99b00a0b249bf0bedef8cf972e8
mm: only display online cpus of the numa node

When I execute numactl -H (which reads /sys/devices/system/node/nodeX/cpumap
and displays cpumask_of_node for each node), I get different result
on X86 and arm64.  For each numa node, the former only displayed online
CPUs, and the latter displayed all possible CPUs.  Unfortunately, both
Linux documentation and numactl manual have not described it clear.

I sent a mail to ask for help, and Michal Hocko replied that he
preferred to print online cpus because it doesn't really make much sense
to bind anything on offline nodes.

Will said:
 "I suspect the vast majority (if not all) code that reads this file was
  developed for x86, so having the same behaviour for arm64 sounds like
  something we should do ASAP before people try to special case with
  things like #ifdef __aarch64__. I'd rather have this in 4.14 if
  possible."

Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Zhen Lei <[email protected]>
Acked-by: Michal Hocko <[email protected]>
Cc: Catalin Marinas <[email protected]>
Cc: Will Deacon <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: Tianhong Ding <[email protected]>
Cc: Hanjun Guo <[email protected]>
Cc: Libin <[email protected]>
Cc: Kefeng Wang <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
drivers/base/node.c