lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <4B6AAA39.6000300@linux.intel.com>
Date:	Thu, 04 Feb 2010 19:06:33 +0800
From:	Haicheng Li <haicheng.li@...ux.intel.com>
To:	"H. Peter Anvin" <hpa@...or.com>,
	Thomas Gleixner <tglx@...utronix.de>,
	Ingo Molnar <mingo@...hat.com>
CC:	Andi Kleen <andi@...stfloor.org>, Suresh.b.siddha@...el.com,
	lenb@...nel.org, trenn@...e.de,
	"Zheng, Shaohui" <shaohui.zheng@...el.com>,
	linux-kernel@...r.kernel.org, "Chen, Gong" <gong.chen@...el.com>,
	"Lv, Jane" <jane.lv@...el.com>
Subject: [PATCH] x86, acpi: map hotadded cpu to correct node.

x86: map hotadded cpu to correct node.

When hotadd new cpu to system, if its affinitive node is online, should map the cpu to its own node. 
otherwise, let kernel select one online node for the new cpu later.

Signed-off-by: Haicheng Li <haicheng.li@...ux.intel.com>
---
  arch/x86/kernel/acpi/boot.c |   21 +++++++++++++++++++++
  1 files changed, 21 insertions(+), 0 deletions(-)

diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c
index 67e929b..92a4861 100644
--- a/arch/x86/kernel/acpi/boot.c
+++ b/arch/x86/kernel/acpi/boot.c
@@ -49,6 +49,7 @@ EXPORT_SYMBOL(acpi_disabled);

  #ifdef	CONFIG_X86_64
  # include <asm/proto.h>
+# include <asm/numa_64.h>
  #endif				/* X86 */

  #define BAD_MADT_ENTRY(entry, end) (					    \
@@ -482,6 +483,25 @@ int acpi_register_gsi(struct device *dev, u32 gsi, int trigger, int polarity)
   */
  #ifdef CONFIG_ACPI_HOTPLUG_CPU

+static void acpi_map_cpu2node(acpi_handle handle, int cpu, int physid)
+{
+#ifdef CONFIG_ACPI_NUMA
+	int nid;
+
+	nid = acpi_get_node(handle);
+	if (!node_online(nid))
+		return;
+#ifdef CONFIG_X86_64
+	apicid_to_node[physid] = nid;
+	numa_set_node(cpu, nid);
+#else /* CONFIG_X86_32 */
+	apicid_2_node[physid] = nid;
+	cpu_to_node_map[cpu] = nid;
+#endif
+
+#endif
+}
+
  static int __cpuinit _acpi_map_lsapic(acpi_handle handle, int *pcpu)
  {
  	struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
@@ -540,6 +560,7 @@ static int __cpuinit _acpi_map_lsapic(acpi_handle handle, int *pcpu)
  	}

  	cpu = cpumask_first(new_map);
+	acpi_map_cpu2node(handle, cpu, physid);

  	*pcpu = cpu;
  	retval = 0;
-- 
1.6.0.rc1




-haicheng
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ