summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPavankumar Kondeti <pkondeti@codeaurora.org>2017-06-16 09:36:25 +0530
committerPavankumar Kondeti <pkondeti@codeaurora.org>2017-06-30 10:41:00 +0530
commit971af7d6edebc1ba813b7a1248bc4f1d6d763c97 (patch)
treed9f4af6446672dd7c8a2f30f4ec8bf23f405fc2a
parentcd6d19b8e42cfef81a1ee3c4e4367295e8025024 (diff)
genirq: honour default IRQ affinity setting during migration
Userspace can set the default IRQ affinity setting by writing into /proc/irq/default_smp_affinity file. When an IRQ affinity is broken during isolation/hotplug,override the affinity to online and un-isolated CPUs from the default affinity CPUs. If no such CPU is available, then only override with cpu_online_mask. Change-Id: I7578728ed0d7c17c5890d9916cfd6451d1968568 Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
-rw-r--r--kernel/irq/cpuhotplug.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/kernel/irq/cpuhotplug.c b/kernel/irq/cpuhotplug.c
index 3dc1dbd9c166..4684b7595e63 100644
--- a/kernel/irq/cpuhotplug.c
+++ b/kernel/irq/cpuhotplug.c
@@ -36,10 +36,21 @@ static bool migrate_one_irq(struct irq_desc *desc)
affinity = &available_cpus;
if (cpumask_any_and(affinity, cpu_online_mask) >= nr_cpu_ids) {
+ /*
+ * The order of preference for selecting a fallback CPU is
+ *
+ * (1) online and un-isolated CPU from default affinity
+ * (2) online and un-isolated CPU
+ * (3) online CPU
+ */
cpumask_andnot(&available_cpus, cpu_online_mask,
cpu_isolated_mask);
- if (cpumask_empty(affinity))
+ if (cpumask_intersects(&available_cpus, irq_default_affinity))
+ cpumask_and(&available_cpus, &available_cpus,
+ irq_default_affinity);
+ else if (cpumask_empty(&available_cpus))
affinity = cpu_online_mask;
+
/*
* We are overriding the affinity with all online and
* un-isolated cpus. irq_set_affinity_locked() call