From: Pingfan Liu <kernelfans@gmail.com>
To: linux-arm-kernel@lists.infradead.org
Cc: Mark Rutland <mark.rutland@arm.com>,
Julien Thierry <julien.thierry@arm.com>,
Catalin Marinas <catalin.marinas@arm.com>,
Pingfan Liu <kernelfans@gmail.com>, Marc Zyngier <maz@kernel.org>,
Will Deacon <will@kernel.org>
Subject: [PATCH 3/3] arm64/irq-gic-v3: make reschedule-ipi light weight
Date: Mon, 14 Dec 2020 10:25:52 +0800 [thread overview]
Message-ID: <1607912752-12481-3-git-send-email-kernelfans@gmail.com> (raw)
In-Reply-To: <1607912752-12481-1-git-send-email-kernelfans@gmail.com>
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 --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)
--
2.29.2
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2020-12-14 2:29 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-08 13:14 [PATCH] arm64/irq: use NMI to send stop IPI Pingfan Liu
2020-12-08 14:04 ` Marc Zyngier
2020-12-14 2:20 ` Pingfan Liu
2020-12-14 2:25 ` [PATCH 1/3] kernel/irq: __handle_domain_irq() makes irq_enter/exit arch optional Pingfan Liu
2020-12-14 2:25 ` [PATCH 2/3] arm64/irq-gic-v3: make gic_handle_irq() cope with enter_from_kernel_mode() Pingfan Liu
2020-12-14 2:25 ` Pingfan Liu [this message]
2020-12-14 9:46 ` [PATCH] arm64/irq: use NMI to send stop IPI Marc Zyngier
2020-12-14 13:04 ` Pingfan Liu
2020-12-14 13:24 ` Marc Zyngier
2020-12-15 5:40 ` Pingfan Liu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1607912752-12481-3-git-send-email-kernelfans@gmail.com \
--to=kernelfans@gmail.com \
--cc=catalin.marinas@arm.com \
--cc=julien.thierry@arm.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=mark.rutland@arm.com \
--cc=maz@kernel.org \
--cc=will@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).