Re: [ACPI] PATCH-ACPI based CPU hotplug[4/6]-Dynamic cpu register/unregister support
by Keshavamurthy Anil S » Sun, 26 Sep 2004 08:50:08 GMT
n Wed, Sep 22, 2004 at 05:34:00PM +0900, Keiichiro Tokunaga wrote:
Refreshed this patch to address the above issues. Please let me know if you see
any other issue with this patch.
---
Name:topology.patch
Status:Tested on 2.6.9-rc2
Signed-off-by: Anil S Keshavamurthy < XXXX@XXXXX.COM >
Depends:
Version: applies on 2.6.9-rc2
Description:
Extends support for dynamic registration and unregistration of the cpu,
by implementing and exporting arch_register_cpu()/arch_unregister_cpu().
Also combines multiple implementation of topology_init() functions to
single topology_init() in case of ia64 architecture.
---
/dev/null | 43 ------
linux-2.6.9-rc2-askeshav/arch/i386/mach-default/topology.c | 31 ++++
linux-2.6.9-rc2-askeshav/arch/ia64/dig/Makefile | 5
linux-2.6.9-rc2-askeshav/arch/ia64/kernel/Makefile | 3
linux-2.6.9-rc2-askeshav/arch/ia64/kernel/topology.c | 90 +++++++++++++
linux-2.6.9-rc2-askeshav/arch/ia64/mm/numa.c | 35 -----
linux-2.6.9-rc2-askeshav/drivers/base/cpu.c | 20 ++
linux-2.6.9-rc2-askeshav/include/asm-i386/cpu.h | 17 --
linux-2.6.9-rc2-askeshav/include/asm-ia64/cpu.h | 5
linux-2.6.9-rc2-askeshav/include/linux/cpu.h | 3
10 files changed, 153 insertions(+), 99 deletions(-)
diff -L arch/ia64/dig/topology.c -puN arch/ia64/dig/topology.c~topology /dev/null
--- linux-2.6.9-rc2/arch/ia64/dig/topology.c
+++ /dev/null 2004-06-30 13:03:36.000000000 -0700
@@ -1,43 +0,0 @@
-/*
- * arch/ia64/dig/topology.c
- * Popuate driverfs with topology information.
- * Derived entirely from i386/mach-default.c
- * Intel Corporation - Ashok Raj
- */
-#include <linux/init.h>
-#include <linux/smp.h>
-#include <linux/cpumask.h>
-#include <linux/percpu.h>
-#include <linux/notifier.h>
-#include <linux/cpu.h>
-#include <asm/cpu.h>
-
-static DEFINE_PER_CPU(struct ia64_cpu, cpu_devices);
-
-/*
- * First Pass: simply borrowed code for now. Later should hook into
- * hotplug notification for node/cpu/memory as applicable
- */
-
-static int arch_register_cpu(int num)
-{
- struct node *parent = NULL;
-
-#ifdef CONFIG_NUMA
- //parent = &node_devices[cpu_to_node(num)].node;
-#endif
-
- return register_cpu(&per_cpu(cpu_devices,num).cpu, num, parent);
-}
-
-static int __init topology_init(void)
-{
- int i;
-
- for_each_cpu(i) {
- arch_register_cpu(i);
- }
- return 0;
-}
-
-subsys_initcall(topology_init);
diff -puN arch/ia64/dig/Makefile~topology arch/ia64/dig/Makefile
--- linux-2.6.9-rc2/arch/ia64/dig/Makefile~topology 2004-09-24 15:26:26.939098651 -0700
+++ linux-2.6.9-rc2-askeshav/arch/ia64/dig/Makefile 2004-09-24 15:26:27.062145524 -0700
@@ -6,9 +6,4 @@
#
obj-y := setup.o
-
-ifndef CONFIG_NUMA
-obj-$(CONFIG_IA64_DIG) += topology.o
-endif
-
obj-$(CONFIG_IA64_GENERIC) += machvec.o
diff -puN arch/ia64/mm/numa.c~topology arch/ia64/mm/numa.c
--- linux-2.6.9-rc2/arch/ia64/mm/numa.c~topology 2004-09-24 15:26:26.943004901 -0700
+++ linux-2.6.9-rc2-askeshav/arch/ia64/mm/numa.c 2004-09-24 15:26:27.063122087 -0700
@@ -20,8 +20,6 @@
#include <asm/mmzone.h>
#include <asm/numa.h>
-static struct node *sysfs_nodes;
-static struct cpu *sysfs_cpus;
/*
* The following structures are usually initialized by ACPI or