提交 08992986 编写于 作者: K KAMEZAWA Hiroyuki 提交者: Linus Torvalds

[PATCH] cpu to node relationship fixup: acpi_map_cpu2node

Problem description:

  We have additional_cpus= option for allocating possible_cpus.  But nid
  for possible cpus are not fixed at boot time.  cpus which is offlined at
  boot or cpus which is not on SRAT is not tied to its node.  This will
  cause panic at cpu onlining.

Usually, pxm_to_nid() mapping is fixed at boot time by SRAT.

But, unfortunately, some system (my system!) do not include
full SRAT table for possible cpus.  (Then, I use
additiona_cpus= option.)

For such possible cpus, pxm<->nid should be fixed at
hot-add.  We now have acpi_map_pxm_to_node() which is also
used at boot.  It's suitable here.
Signed-off-by: NKAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: "Luck, Tony" <tony.luck@intel.com>
Cc: <stable@kernel.org>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 25981de5
...@@ -771,16 +771,19 @@ int acpi_map_cpu2node(acpi_handle handle, int cpu, long physid) ...@@ -771,16 +771,19 @@ int acpi_map_cpu2node(acpi_handle handle, int cpu, long physid)
{ {
#ifdef CONFIG_ACPI_NUMA #ifdef CONFIG_ACPI_NUMA
int pxm_id; int pxm_id;
int nid;
pxm_id = acpi_get_pxm(handle); pxm_id = acpi_get_pxm(handle);
/* /*
* Assuming that the container driver would have set the proximity * We don't have cpu-only-node hotadd. But if the system equips
* domain and would have initialized pxm_to_node(pxm_id) && pxm_flag * SRAT table, pxm is already found and node is ready.
* So, just pxm_to_nid(pxm) is OK.
* This code here is for the system which doesn't have full SRAT
* table for possible cpus.
*/ */
node_cpuid[cpu].nid = (pxm_id < 0) ? 0 : pxm_to_node(pxm_id); nid = acpi_map_pxm_to_node(pxm_id);
node_cpuid[cpu].phys_id = physid; node_cpuid[cpu].phys_id = physid;
node_cpuid[cpu].nid = nid;
#endif #endif
return (0); return (0);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册