]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
parisc: Improve initial IRQ to CPU assignment
authorHelge Deller <deller@gmx.de>
Fri, 4 Jan 2019 23:05:46 +0000 (00:05 +0100)
committerHelge Deller <deller@gmx.de>
Thu, 21 Feb 2019 19:37:11 +0000 (20:37 +0100)
On parisc, each IRQ can only be handled by one CPU, and currently CPU0
is choosen as default for handling all IRQs by default.
With this patch we now assign each requested IRQ to one of the online
CPUs (and thus distribute the IRQs across all CPUs), even without an
instance of irqbalance running.

Signed-off-by: Helge Deller <deller@gmx.de>
arch/parisc/kernel/irq.c

index 6f19f364c20aba573bd6d409c0ff4bfe076f4eb9..23040a67583e427ebf47967501bfccc4d30e62a6 100644 (file)
@@ -117,7 +117,10 @@ int cpu_check_affinity(struct irq_data *d, const struct cpumask *dest)
                return -EINVAL;
 
        /* whatever mask they set, we just allow one CPU */
-       cpu_dest = cpumask_first_and(dest, cpu_online_mask);
+       cpu_dest = cpumask_next_and(d->irq & (num_online_cpus()-1),
+                                       dest, cpu_online_mask);
+       if (cpu_dest >= nr_cpu_ids)
+               cpu_dest = cpumask_first_and(dest, cpu_online_mask);
 
        return cpu_dest;
 }