cpumask: use alloc_cpumask_var_node where appropriate
authorMike Travis <travis@sgi.com>
Thu, 1 Jan 2009 02:08:47 +0000 (18:08 -0800)
committerIngo Molnar <mingo@elte.hu>
Sat, 3 Jan 2009 18:15:40 +0000 (19:15 +0100)
Impact: Reduce inter-node memory traffic.

Reduces inter-node memory traffic (offloading the global system bus)
by allocating referenced struct cpumasks on the same node as the
referring struct.

Signed-off-by: Mike Travis <travis@sgi.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c
arch/x86/kernel/io_apic.c

index d0a001093b2d52d5583b6eb8fdf552978323e68d..28102ad1a36360a2ceff7d1692f1e4309db075bb 100644 (file)
@@ -547,8 +547,9 @@ static int __init acpi_cpufreq_early_init(void)
                return -ENOMEM;
        }
        for_each_possible_cpu(i) {
-               if (!alloc_cpumask_var(&per_cpu_ptr(acpi_perf_data, i)
-                                      ->shared_cpu_map, GFP_KERNEL)) {
+               if (!alloc_cpumask_var_node(
+                       &per_cpu_ptr(acpi_perf_data, i)->shared_cpu_map,
+                       GFP_KERNEL, cpu_to_node(i))) {
 
                        /* Freeing a NULL pointer is OK: alloc_percpu zeroes. */
                        free_acpi_perf_data();
index 3e070bb961d7dbda51ec1af815b13b5b89b78951..a25c3f76b8ac20604795235f28cdc6d49ad0dec3 100644 (file)
@@ -212,11 +212,11 @@ static struct irq_cfg *get_one_free_irq_cfg(int cpu)
 
        cfg = kzalloc_node(sizeof(*cfg), GFP_ATOMIC, node);
        if (cfg) {
-               /* FIXME: needs alloc_cpumask_var_node() */
-               if (!alloc_cpumask_var(&cfg->domain, GFP_ATOMIC)) {
+               if (!alloc_cpumask_var_node(&cfg->domain, GFP_ATOMIC, node)) {
                        kfree(cfg);
                        cfg = NULL;
-               } else if (!alloc_cpumask_var(&cfg->old_domain, GFP_ATOMIC)) {
+               } else if (!alloc_cpumask_var_node(&cfg->old_domain,
+                                                         GFP_ATOMIC, node)) {
                        free_cpumask_var(cfg->domain);
                        kfree(cfg);
                        cfg = NULL;