aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/processor_core.c
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2008-12-31 21:08:47 -0500
committerIngo Molnar <mingo@elte.hu>2009-01-03 13:15:40 -0500
commit2fdf66b491ac706657946442789ec644cc317e1a (patch)
tree3442c3e1f7bceb870ab1ba2624e21767f8347508 /drivers/acpi/processor_core.c
parentee943a82b697456f9d2ac46f1e6d230beedb4b6c (diff)
cpumask: convert shared_cpu_map in acpi_processor* structs to cpumask_var_t
Impact: Reduce memory usage, use new API. This is part of an effort to reduce structure sizes for machines configured with large NR_CPUS. cpumask_t gets replaced by cpumask_var_t, which is either struct cpumask[1] (small NR_CPUS) or struct cpumask * (large NR_CPUS). (Changes to powernow-k* by <travis>.) Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Signed-off-by: Mike Travis <travis@sgi.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'drivers/acpi/processor_core.c')
-rw-r--r--drivers/acpi/processor_core.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/drivers/acpi/processor_core.c b/drivers/acpi/processor_core.c
index 34948362f41..0cc2fd31e37 100644
--- a/drivers/acpi/processor_core.c
+++ b/drivers/acpi/processor_core.c
@@ -826,6 +826,11 @@ static int acpi_processor_add(struct acpi_device *device)
826 if (!pr) 826 if (!pr)
827 return -ENOMEM; 827 return -ENOMEM;
828 828
829 if (!alloc_cpumask_var(&pr->throttling.shared_cpu_map, GFP_KERNEL)) {
830 kfree(pr);
831 return -ENOMEM;
832 }
833
829 pr->handle = device->handle; 834 pr->handle = device->handle;
830 strcpy(acpi_device_name(device), ACPI_PROCESSOR_DEVICE_NAME); 835 strcpy(acpi_device_name(device), ACPI_PROCESSOR_DEVICE_NAME);
831 strcpy(acpi_device_class(device), ACPI_PROCESSOR_CLASS); 836 strcpy(acpi_device_class(device), ACPI_PROCESSOR_CLASS);
@@ -845,10 +850,8 @@ static int acpi_processor_remove(struct acpi_device *device, int type)
845 850
846 pr = acpi_driver_data(device); 851 pr = acpi_driver_data(device);
847 852
848 if (pr->id >= nr_cpu_ids) { 853 if (pr->id >= nr_cpu_ids)
849 kfree(pr); 854 goto free;
850 return 0;
851 }
852 855
853 if (type == ACPI_BUS_REMOVAL_EJECT) { 856 if (type == ACPI_BUS_REMOVAL_EJECT) {
854 if (acpi_processor_handle_eject(pr)) 857 if (acpi_processor_handle_eject(pr))
@@ -873,6 +876,9 @@ static int acpi_processor_remove(struct acpi_device *device, int type)
873 876
874 per_cpu(processors, pr->id) = NULL; 877 per_cpu(processors, pr->id) = NULL;
875 per_cpu(processor_device_array, pr->id) = NULL; 878 per_cpu(processor_device_array, pr->id) = NULL;
879
880free:
881 free_cpumask_var(pr->throttling.shared_cpu_map);
876 kfree(pr); 882 kfree(pr);
877 883
878 return 0; 884 return 0;