diff mbox series

[3/3] arm64/irq-gic-v3: make reschedule-ipi light weight

Message ID 1607912752-12481-3-git-send-email-kernelfans@gmail.com (mailing list archive)
State New, archived
Headers show
Series [1/3] kernel/irq: __handle_domain_irq() makes irq_enter/exit arch optional | expand

Commit Message

Pingfan Liu Dec. 14, 2020, 2:25 a.m. UTC
To achieve the light weight as
DEFINE_IDTENTRY_SYSVEC_SIMPLE(sysvec_reschedule_ipi) on x86, it had
better treat irqnr differently at the frontend. And let IPI_RESCHEDULE
call __irq_enter_raw() instead of irq_enter_rcu().

Signed-off-by: Pingfan Liu <kernelfans@gmail.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Marc Zyngier <maz@kernel.org>
Cc: Julien Thierry <julien.thierry@arm.com>
To: linux-arm-kernel@lists.infradead.org
---
 drivers/irqchip/irq-gic-v3.c | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/drivers/irqchip/irq-gic-v3.c b/drivers/irqchip/irq-gic-v3.c
index a66e0b04e42b..777f5ace6862 100644
--- a/drivers/irqchip/irq-gic-v3.c
+++ b/drivers/irqchip/irq-gic-v3.c
@@ -642,6 +642,9 @@  static inline void gic_handle_nmi(u32 irqnr, struct pt_regs *regs)
 		nmi_exit();
 }
 
+/* RESCHEDULE IPI hwirq nr is 0, and the only raw one */
+static unsigned long raw_interrupt_mask = 1;
+
 static asmlinkage void __exception_irq_entry gic_handle_irq(struct pt_regs *regs)
 {
 	u32 irqnr;
@@ -654,7 +657,10 @@  static asmlinkage void __exception_irq_entry gic_handle_irq(struct pt_regs *regs
 		return;
 	}
 
-	irq_enter_rcu();
+	if (raw_interrupt_mask & 1 << irqnr)
+		__irq_enter_raw();
+	else
+		irq_enter_rcu();
 	if (gic_prio_masking_enabled()) {
 		gic_pmr_mask_irqs();
 		gic_arch_enable_irqs();
@@ -675,7 +681,10 @@  static asmlinkage void __exception_irq_entry gic_handle_irq(struct pt_regs *regs
 		WARN_ONCE(true, "Unexpected interrupt received!\n");
 		gic_deactivate_unhandled(irqnr);
 	}
-	irq_exit_rcu();
+	if (raw_interrupt_mask & 1 << irqnr)
+		__irq_exit_raw();
+	else
+		irq_exit_rcu();
 }
 
 static u32 gic_get_pribits(void)