path: root/kernel
diff options
authorThomas Gleixner <tglx@linutronix.de>2012-05-25 16:59:47 +0200
committerJon Medhurst <tixy@linaro.org>2014-01-22 09:50:41 +0000
commit6bfbe7d9f891dc145ed395cf2b8c23b2dd9c74e8 (patch)
tree97cb2bb7f7296719bdefe9ff092c4b75148d8975 /kernel
parentedecdef95ad50910270915aa0cdcf2f624301cac (diff)
genirq: Add default affinity mask command line option
If we isolate CPUs, then we don't want random device interrupts on them. Even w/o the user space irq balancer enabled we can end up with irqs on non boot cpus. Allow to restrict the default irq affinity mask. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Jon Medhurst <tixy@linaro.org>
Diffstat (limited to 'kernel')
1 files changed, 19 insertions, 2 deletions
diff --git a/kernel/irq/irqdesc.c b/kernel/irq/irqdesc.c
index 192a302d6cf..473b2b6eccb 100644
--- a/kernel/irq/irqdesc.c
+++ b/kernel/irq/irqdesc.c
@@ -23,10 +23,27 @@
static struct lock_class_key irq_desc_lock_class;
#if defined(CONFIG_SMP)
+static int __init irq_affinity_setup(char *str)
+ zalloc_cpumask_var(&irq_default_affinity, GFP_NOWAIT);
+ cpulist_parse(str, irq_default_affinity);
+ /*
+ * Set at least the boot cpu. We don't want to end up with
+ * bugreports caused by random comandline masks
+ */
+ cpumask_set_cpu(smp_processor_id(), irq_default_affinity);
+ return 1;
+__setup("irqaffinity=", irq_affinity_setup);
static void __init init_irq_default_affinity(void)
- alloc_cpumask_var(&irq_default_affinity, GFP_NOWAIT);
- cpumask_setall(irq_default_affinity);
+ if (!irq_default_affinity)
+ zalloc_cpumask_var(&irq_default_affinity, GFP_NOWAIT);
+ if (cpumask_empty(irq_default_affinity))
+ cpumask_setall(irq_default_affinity);
static void __init init_irq_default_affinity(void)