diff options
author | Tony Luck <tony.luck@intel.com> | 2006-02-15 18:17:57 -0500 |
---|---|---|
committer | Tony Luck <tony.luck@intel.com> | 2006-02-15 18:17:57 -0500 |
commit | 72166c35f0e15e5081e51304de48e73f8fdf5498 (patch) | |
tree | 0515dfa0fc442f92ecbb9add2bc53ca86016a8d6 /arch | |
parent | b05de01ae1c76b7d61da21bbcc26345bf7a9052f (diff) | |
parent | a6b14fa6fdc01ab3519c2729624f808677539b59 (diff) |
Pull fix-cpu-possible-map into release branch
Diffstat (limited to 'arch')
-rw-r--r-- | arch/ia64/kernel/acpi.c | 56 | ||||
-rw-r--r-- | arch/ia64/kernel/setup.c | 4 | ||||
-rw-r--r-- | arch/ia64/kernel/smpboot.c | 5 |
3 files changed, 61 insertions, 4 deletions
diff --git a/arch/ia64/kernel/acpi.c b/arch/ia64/kernel/acpi.c index d2702c419cf8..34795ede72e0 100644 --- a/arch/ia64/kernel/acpi.c +++ b/arch/ia64/kernel/acpi.c | |||
@@ -761,6 +761,62 @@ int acpi_map_cpu2node(acpi_handle handle, int cpu, long physid) | |||
761 | return (0); | 761 | return (0); |
762 | } | 762 | } |
763 | 763 | ||
764 | int additional_cpus __initdata = -1; | ||
765 | |||
766 | static __init int setup_additional_cpus(char *s) | ||
767 | { | ||
768 | if (s) | ||
769 | additional_cpus = simple_strtol(s, NULL, 0); | ||
770 | |||
771 | return 0; | ||
772 | } | ||
773 | |||
774 | early_param("additional_cpus", setup_additional_cpus); | ||
775 | |||
776 | /* | ||
777 | * cpu_possible_map should be static, it cannot change as cpu's | ||
778 | * are onlined, or offlined. The reason is per-cpu data-structures | ||
779 | * are allocated by some modules at init time, and dont expect to | ||
780 | * do this dynamically on cpu arrival/departure. | ||
781 | * cpu_present_map on the other hand can change dynamically. | ||
782 | * In case when cpu_hotplug is not compiled, then we resort to current | ||
783 | * behaviour, which is cpu_possible == cpu_present. | ||
784 | * - Ashok Raj | ||
785 | * | ||
786 | * Three ways to find out the number of additional hotplug CPUs: | ||
787 | * - If the BIOS specified disabled CPUs in ACPI/mptables use that. | ||
788 | * - The user can overwrite it with additional_cpus=NUM | ||
789 | * - Otherwise don't reserve additional CPUs. | ||
790 | */ | ||
791 | __init void prefill_possible_map(void) | ||
792 | { | ||
793 | int i; | ||
794 | int possible, disabled_cpus; | ||
795 | |||
796 | disabled_cpus = total_cpus - available_cpus; | ||
797 | if (additional_cpus == -1) { | ||
798 | if (disabled_cpus > 0) { | ||
799 | possible = total_cpus; | ||
800 | additional_cpus = disabled_cpus; | ||
801 | } | ||
802 | else { | ||
803 | possible = available_cpus; | ||
804 | additional_cpus = 0; | ||
805 | } | ||
806 | } else { | ||
807 | possible = available_cpus + additional_cpus; | ||
808 | } | ||
809 | if (possible > NR_CPUS) | ||
810 | possible = NR_CPUS; | ||
811 | |||
812 | printk(KERN_INFO "SMP: Allowing %d CPUs, %d hotplug CPUs\n", | ||
813 | possible, | ||
814 | max_t(int, additional_cpus, 0)); | ||
815 | |||
816 | for (i = 0; i < possible; i++) | ||
817 | cpu_set(i, cpu_possible_map); | ||
818 | } | ||
819 | |||
764 | int acpi_map_lsapic(acpi_handle handle, int *pcpu) | 820 | int acpi_map_lsapic(acpi_handle handle, int *pcpu) |
765 | { | 821 | { |
766 | struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL }; | 822 | struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL }; |
diff --git a/arch/ia64/kernel/setup.c b/arch/ia64/kernel/setup.c index 35f7835294a3..3258e09278d0 100644 --- a/arch/ia64/kernel/setup.c +++ b/arch/ia64/kernel/setup.c | |||
@@ -430,6 +430,7 @@ setup_arch (char **cmdline_p) | |||
430 | if (early_console_setup(*cmdline_p) == 0) | 430 | if (early_console_setup(*cmdline_p) == 0) |
431 | mark_bsp_online(); | 431 | mark_bsp_online(); |
432 | 432 | ||
433 | parse_early_param(); | ||
433 | #ifdef CONFIG_ACPI | 434 | #ifdef CONFIG_ACPI |
434 | /* Initialize the ACPI boot-time table parser */ | 435 | /* Initialize the ACPI boot-time table parser */ |
435 | acpi_table_init(); | 436 | acpi_table_init(); |
@@ -688,6 +689,9 @@ void | |||
688 | setup_per_cpu_areas (void) | 689 | setup_per_cpu_areas (void) |
689 | { | 690 | { |
690 | /* start_kernel() requires this... */ | 691 | /* start_kernel() requires this... */ |
692 | #ifdef CONFIG_ACPI_HOTPLUG_CPU | ||
693 | prefill_possible_map(); | ||
694 | #endif | ||
691 | } | 695 | } |
692 | 696 | ||
693 | /* | 697 | /* |
diff --git a/arch/ia64/kernel/smpboot.c b/arch/ia64/kernel/smpboot.c index 8f44e7d2df66..b681ef34a86e 100644 --- a/arch/ia64/kernel/smpboot.c +++ b/arch/ia64/kernel/smpboot.c | |||
@@ -129,7 +129,7 @@ DEFINE_PER_CPU(int, cpu_state); | |||
129 | /* Bitmasks of currently online, and possible CPUs */ | 129 | /* Bitmasks of currently online, and possible CPUs */ |
130 | cpumask_t cpu_online_map; | 130 | cpumask_t cpu_online_map; |
131 | EXPORT_SYMBOL(cpu_online_map); | 131 | EXPORT_SYMBOL(cpu_online_map); |
132 | cpumask_t cpu_possible_map; | 132 | cpumask_t cpu_possible_map = CPU_MASK_NONE; |
133 | EXPORT_SYMBOL(cpu_possible_map); | 133 | EXPORT_SYMBOL(cpu_possible_map); |
134 | 134 | ||
135 | cpumask_t cpu_core_map[NR_CPUS] __cacheline_aligned; | 135 | cpumask_t cpu_core_map[NR_CPUS] __cacheline_aligned; |
@@ -506,9 +506,6 @@ smp_build_cpu_map (void) | |||
506 | 506 | ||
507 | for (cpu = 0; cpu < NR_CPUS; cpu++) { | 507 | for (cpu = 0; cpu < NR_CPUS; cpu++) { |
508 | ia64_cpu_to_sapicid[cpu] = -1; | 508 | ia64_cpu_to_sapicid[cpu] = -1; |
509 | #ifdef CONFIG_HOTPLUG_CPU | ||
510 | cpu_set(cpu, cpu_possible_map); | ||
511 | #endif | ||
512 | } | 509 | } |
513 | 510 | ||
514 | ia64_cpu_to_sapicid[0] = boot_cpu_id; | 511 | ia64_cpu_to_sapicid[0] = boot_cpu_id; |