Skip to contentSkip to conversation

x86: use zalloc_cpumask_var in arch_early_irq_init

PATCH In review Yinghai Lu 3 participants 6 messages Jun 11, 2009 – Jun 13, 2009

Subsystems (2)
lore
Share & tools
lore

Yinghai Lu

author
#0 lore raw

PATCH 1/1 x86: use zalloc_cpumask_var in arch_early_irq_init

So could make sure MAXSMP get clearred cpumask

---
 arch/x86/kernel/apic/io_apic.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/x86/kernel/apic/io_apic.c +2 -2
Index: linux-2.6/arch/x86/kernel/apic/io_apic.c
===================================================================
@@ -187,8 +187,8 @@ int __init arch_early_irq_init(void)
 	for (i = 0; i < count; i++) {
 		desc = irq_to_desc(i);
 		desc->chip_data = &cfg[i];
-		alloc_cpumask_var_node(&cfg[i].domain, GFP_NOWAIT, node);
-		alloc_cpumask_var_node(&cfg[i].old_domain, GFP_NOWAIT, node);
+		zalloc_cpumask_var_node(&cfg[i].domain, GFP_NOWAIT, node);
+		zalloc_cpumask_var_node(&cfg[i].old_domain, GFP_NOWAIT, node);
 		if (i < NR_IRQS_LEGACY)
 			cpumask_setall(cfg[i].domain);
 	}
author
#1 lore raw

PATCH 1/1 kvm: remove the duplicated cpumask_clear

zalloc_cpumask_var already had that clear.

---
 virt/kvm/kvm_main.c |    1 -
 1 file changed, 1 deletion(-)
virt/kvm/kvm_main.c +0 -1
Index: linux-2.6/virt/kvm/kvm_main.c
===================================================================
@@ -2305,7 +2305,6 @@ int kvm_init(void *opaque, unsigned int
 		r = -ENOMEM;
 		goto out_free_0;
 	}
-	cpumask_clear(cpus_hardware_enabled);
 
 	r = kvm_arch_hardware_setup();
 	if (r < 0)
#2 lore raw

Re: [PATCH] kvm: remove the duplicated cpumask_clear

Quoted 1 line · Yinghai Lu

zalloc_cpumask_var already had that clear.

Only because of your previous patch... I've folded them into one patch for Avi:

Subject: kvm: use zalloc_cpumask_var instead of cpumask_clear

---
 virt/kvm/kvm_main.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
virt/kvm/kvm_main.c +1 -2
@@ -2301,11 +2301,10 @@ int kvm_init(void *opaque, unsigned int 
 
 	bad_pfn = page_to_pfn(bad_page);
 
-	if (!alloc_cpumask_var(&cpus_hardware_enabled, GFP_KERNEL)) {
+	if (!zalloc_cpumask_var(&cpus_hardware_enabled, GFP_KERNEL)) {
 		r = -ENOMEM;
 		goto out_free_0;
 	}
-	cpumask_clear(cpus_hardware_enabled);
 
 	r = kvm_arch_hardware_setup();
 	if (r < 0)
#4 lore raw
Quoted 6 lines · Rusty Russell
Quoted 3 lines · Yinghai Lu

So could make sure MAXSMP get clearred cpumask

Ingo, this only applies to your tree; can you take it?

should apply to upstream too so could go into your tree with the other cpumask changes, right?

Ingo

#5 lore raw
Quoted 10 lines · Ingo Molnar
Quoted 6 lines · Rusty Russell
Quoted 3 lines · Yinghai Lu

So could make sure MAXSMP get clearred cpumask

Ingo, this only applies to your tree; can you take it?

should apply to upstream too so could go into your tree with the other cpumask changes, right?

Yep, I hadn't pulled for a while. I'll take it now.

Thanks,
Rusty.