Re: [PULL] cpumask tree

From: David Daney
Date: Thu Jan 08 2009 - 14:11:19 EST


Rusty Russell wrote:
commit d036e67b40f52bdd95392390108defbac7e53837
Author: Rusty Russell <rusty@xxxxxxxxxxxxxxx>
Date: Thu Jan 1 10:12:26 2009 +1030

cpumask: convert kernel/irq
Impact: Reduce stack usage, use new cpumask API. ALPHA mod!
Main change is that irq_default_affinity becomes a cpumask_var_t, so
treat it as a pointer (this effects alpha).
Signed-off-by: Rusty Russell <rusty@xxxxxxxxxxxxxxx>


Which contains:

diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c
index 61c4a9b..cd0cd8d 100644
--- a/kernel/irq/manage.c
+++ b/kernel/irq/manage.c
@@ -16,8 +16,15 @@
#include "internals.h"
#ifdef CONFIG_SMP
+cpumask_var_t irq_default_affinity;
-cpumask_t irq_default_affinity = CPU_MASK_ALL;
+static int init_irq_default_affinity(void)
+{
+ alloc_cpumask_var(&irq_default_affinity, GFP_KERNEL);
+ cpumask_setall(irq_default_affinity);
+ return 0;
+}
+core_initcall(init_irq_default_affinity);

I think core_initcall is too late to be initializing irq_default_affinity. This happens way after init_IRQ() is called and for my target (mips/cavium_octeon) after the timer and SMP related irqs are setup.

I had been setting irq_default_affinity in init_IRQ(), and I could probably do it later with no real problem, but this seems wrong to me. Data that is potentially used in interrupt configuration and processing should be initialized before it is used.

David Daney
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/