On Fri, 21 May 2010 16:22:19 +0800
minskey guo<chaohong_guo@xxxxxxxxxxxxxxx> wrote:
Yes. I can use cpu_to_mem(). only some little difference during
CPU online: 1st cpu within memoryless node gets memory from current
node or the node to which the cpu0 belongs,
But I have a question about the patch:
numa-slab-use-numa_mem_id-for-slab-local-memory-node.patch,
@@ -2968,9 +2991,23 @@ static int __build_all_zonelists(void *d
...
- for_each_possible_cpu(cpu)
+ for_each_possible_cpu(cpu) {
setup_pageset(&per_cpu(boot_pageset, cpu), 0);
...
+#ifdef CONFIG_HAVE_MEMORYLESS_NODES
+ if (cpu_online(cpu))
+ cpu_to_mem(cpu) = local_memory_node(cpu_to_node(cpu));
+#endif
So, cpu_to_node(cpu) for possible cpus will have NUMA_NO_NODE(-1)
or the number of the nearest node.
IIUC, if SRAT is not broken, all pxm has its own node_id.