Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1670080 > unrolled thread
| Started by | Thomas Gleixner <tglx@linutronix.de> |
|---|---|
| First post | 2017-06-20 02:10 +0200 |
| Last post | 2017-06-22 19:10 +0200 |
| Articles | 2 — 2 participants |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
[patch 30/55] genirq/cpuhotplug: Add support for conditional masking Thomas Gleixner <tglx@linutronix.de> - 2017-06-20 02:10 +0200
[tip:irq/core] genirq/cpuhotplug: Add support for conditional masking tip-bot for Thomas Gleixner <tipbot@zytor.com> - 2017-06-22 19:10 +0200
| From | Thomas Gleixner <tglx@linutronix.de> |
|---|---|
| Date | 2017-06-20 02:10 +0200 |
| Subject | [patch 30/55] genirq/cpuhotplug: Add support for conditional masking |
| Message-ID | <tUeU3-1fU-41@gated-at.bofh.it> |
Interrupts which cannot be migrated in process context, need to be masked
before the affinity is changed forcefully.
Add support for that. Will be compiled out for architectures which do not
have this x86 specific issue.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
kernel/irq/cpuhotplug.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
--- a/kernel/irq/cpuhotplug.c
+++ b/kernel/irq/cpuhotplug.c
@@ -18,6 +18,7 @@ static bool migrate_one_irq(struct irq_d
{
struct irq_data *d = irq_desc_get_irq_data(desc);
struct irq_chip *chip = irq_data_get_irq_chip(d);
+ bool maskchip = !irq_can_move_pcntxt(d) && !irqd_irq_masked(d);
const struct cpumask *affinity;
bool brokeaff = false;
int err;
@@ -69,6 +70,10 @@ static bool migrate_one_irq(struct irq_d
if (irq_fixup_move_pending(desc, true))
affinity = irq_desc_get_pending_mask(desc);
+ /* Mask the chip for interrupts which cannot move in process context */
+ if (maskchip && chip->irq_mask)
+ chip->irq_mask(d);
+
if (cpumask_any_and(affinity, cpu_online_mask) >= nr_cpu_ids) {
affinity = cpu_online_mask;
brokeaff = true;
@@ -78,8 +83,12 @@ static bool migrate_one_irq(struct irq_d
if (err) {
pr_warn_ratelimited("IRQ%u: set affinity failed(%d).\n",
d->irq, err);
- return false;
+ brokeaff = false;
}
+
+ if (maskchip && chip->irq_unmask)
+ chip->irq_unmask(d);
+
return brokeaff;
}
[toc] | [next] | [standalone]
| From | tip-bot for Thomas Gleixner <tipbot@zytor.com> |
|---|---|
| Date | 2017-06-22 19:10 +0200 |
| Subject | [tip:irq/core] genirq/cpuhotplug: Add support for conditional masking |
| Message-ID | <tVdMe-7Ei-27@gated-at.bofh.it> |
| In reply to | #1670080 |
Commit-ID: 47a06d3a783217acae02976f15ca07ddc1ac024f
Gitweb: http://git.kernel.org/tip/47a06d3a783217acae02976f15ca07ddc1ac024f
Author: Thomas Gleixner <tglx@linutronix.de>
AuthorDate: Tue, 20 Jun 2017 01:37:30 +0200
Committer: Thomas Gleixner <tglx@linutronix.de>
CommitDate: Thu, 22 Jun 2017 18:21:17 +0200
genirq/cpuhotplug: Add support for conditional masking
Interrupts which cannot be migrated in process context, need to be masked
before the affinity is changed forcefully.
Add support for that. Will be compiled out for architectures which do not
have this x86 specific issue.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: Marc Zyngier <marc.zyngier@arm.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Keith Busch <keith.busch@intel.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Christoph Hellwig <hch@lst.de>
Link: http://lkml.kernel.org/r/20170619235445.604565591@linutronix.de
---
kernel/irq/cpuhotplug.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/kernel/irq/cpuhotplug.c b/kernel/irq/cpuhotplug.c
index 4be4bd6..6f46587 100644
--- a/kernel/irq/cpuhotplug.c
+++ b/kernel/irq/cpuhotplug.c
@@ -18,6 +18,7 @@ static bool migrate_one_irq(struct irq_desc *desc)
{
struct irq_data *d = irq_desc_get_irq_data(desc);
struct irq_chip *chip = irq_data_get_irq_chip(d);
+ bool maskchip = !irq_can_move_pcntxt(d) && !irqd_irq_masked(d);
const struct cpumask *affinity;
bool brokeaff = false;
int err;
@@ -69,6 +70,10 @@ static bool migrate_one_irq(struct irq_desc *desc)
if (irq_fixup_move_pending(desc, true))
affinity = irq_desc_get_pending_mask(desc);
+ /* Mask the chip for interrupts which cannot move in process context */
+ if (maskchip && chip->irq_mask)
+ chip->irq_mask(d);
+
if (cpumask_any_and(affinity, cpu_online_mask) >= nr_cpu_ids) {
affinity = cpu_online_mask;
brokeaff = true;
@@ -78,8 +83,12 @@ static bool migrate_one_irq(struct irq_desc *desc)
if (err) {
pr_warn_ratelimited("IRQ%u: set affinity failed(%d).\n",
d->irq, err);
- return false;
+ brokeaff = false;
}
+
+ if (maskchip && chip->irq_unmask)
+ chip->irq_unmask(d);
+
return brokeaff;
}
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web