hc
2024-01-04 1543e317f1da31b75942316931e8f491a8920811
kernel/kernel/irq/cpuhotplug.c
....@@ -12,6 +12,7 @@
1212 #include <linux/interrupt.h>
1313 #include <linux/ratelimit.h>
1414 #include <linux/irq.h>
15
+#include <linux/sched/isolation.h>
1516
1617 #include "internals.h"
1718
....@@ -41,7 +42,7 @@
4142 * If this happens then there was a missed IRQ fixup at some
4243 * point. Warn about it and enforce fixup.
4344 */
44
- pr_warn("Eff. affinity %*pbl of IRQ %u contains only offline CPUs after offlining CPU %u\n",
45
+ pr_debug("Eff. affinity %*pbl of IRQ %u contains only offline CPUs after offlining CPU %u\n",
4546 cpumask_pr_args(m), d->irq, cpu);
4647 return true;
4748 }
....@@ -165,10 +166,24 @@
165166 raw_spin_unlock(&desc->lock);
166167
167168 if (affinity_broken) {
168
- pr_warn_ratelimited("IRQ %u: no longer affine to CPU%u\n",
169
+ pr_debug_ratelimited("IRQ %u: no longer affine to CPU%u\n",
169170 irq, smp_processor_id());
170171 }
171172 }
173
+}
174
+
175
+static bool hk_should_isolate(struct irq_data *data, unsigned int cpu)
176
+{
177
+ const struct cpumask *hk_mask;
178
+
179
+ if (!housekeeping_enabled(HK_FLAG_MANAGED_IRQ))
180
+ return false;
181
+
182
+ hk_mask = housekeeping_cpumask(HK_FLAG_MANAGED_IRQ);
183
+ if (cpumask_subset(irq_data_get_effective_affinity_mask(data), hk_mask))
184
+ return false;
185
+
186
+ return cpumask_test_cpu(cpu, hk_mask);
172187 }
173188
174189 static void irq_restore_affinity_of_irq(struct irq_desc *desc, unsigned int cpu)
....@@ -188,9 +203,11 @@
188203 /*
189204 * If the interrupt can only be directed to a single target
190205 * CPU then it is already assigned to a CPU in the affinity
191
- * mask. No point in trying to move it around.
206
+ * mask. No point in trying to move it around unless the
207
+ * isolation mechanism requests to move it to an upcoming
208
+ * housekeeping CPU.
192209 */
193
- if (!irqd_is_single_target(data))
210
+ if (!irqd_is_single_target(data) || hk_should_isolate(data, cpu))
194211 irq_set_affinity_locked(data, affinity, false);
195212 }
196213