From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1CE00C433EF for ; Fri, 1 Oct 2021 09:17:11 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id CEEFC610C8 for ; Fri, 1 Oct 2021 09:17:10 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org CEEFC610C8 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Subject:Cc:To:From:Message-ID:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=UG0bQWtzTdWEWqdRbb2Ol+N3q4KTzx1p460aPrKzvms=; b=ePCx/J+mcLB/LS 2fnZtX8wN/PrPOBCH9AuMkv4fJOi/0vkDvdZpVSFjvlRNbHAM4SSXpTTau9u5Jc2zrbk6yW72vI5t lfOQN6YQs+/sdCwchoDkZQkkhwYReKf5WVYf6ep98/S2U53u4dfwje4pyHs+0ZRSfGeg/vFdAvGvk GhdJxIyeb4cp3H8en/H7LqH+c+w9lqVll/nQUi0FnYDMtEWJVXHy5m0e4eqg4OdKslsGc1rKpP10L /2p4sv4oKL2yNBfdcUoAwQ20XqOtBe9hkQCvvyA2WV09W1Ehf7KgtHWYIc8Z5CY2rq6244oXc28Vo 0d+a8Hu54E/+RFT5qqww==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mWEdY-00HBIz-4k; Fri, 01 Oct 2021 09:15:24 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mWEdU-00HBIN-BH for linux-arm-kernel@lists.infradead.org; Fri, 01 Oct 2021 09:15:21 +0000 Received: from disco-boy.misterjones.org (disco-boy.misterjones.org [51.254.78.96]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 78BFF61A88; Fri, 1 Oct 2021 09:15:19 +0000 (UTC) Received: from sofa.misterjones.org ([185.219.108.64] helo=why.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1mWEdR-00E9sE-I7; Fri, 01 Oct 2021 10:15:17 +0100 Date: Fri, 01 Oct 2021 10:15:16 +0100 Message-ID: <87sfxlrtqz.wl-maz@kernel.org> From: Marc Zyngier To: Pingfan Liu Cc: linux-arm-kernel@lists.infradead.org, Mark Rutland , "Paul E. McKenney" , Catalin Marinas , Will Deacon , Joey Gouly , Sami Tolvanen , Julien Thierry , Thomas Gleixner , Yuichi Ito , linux-kernel@vger.kernel.org Subject: Re: [PATCHv3 1/3] kernel/irq: make irq_{enter, exit}() in handle_domain_irq() arch optional In-Reply-To: <20210930131708.35328-2-kernelfans@gmail.com> References: <20210930131708.35328-1-kernelfans@gmail.com> <20210930131708.35328-2-kernelfans@gmail.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/27.1 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: kernelfans@gmail.com, linux-arm-kernel@lists.infradead.org, mark.rutland@arm.com, paulmck@kernel.org, catalin.marinas@arm.com, will@kernel.org, joey.gouly@arm.com, samitolvanen@google.com, julien.thierry@arm.com, tglx@linutronix.de, ito-yuichi@fujitsu.com, linux-kernel@vger.kernel.org X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211001_021520_445262_477A777F X-CRM114-Status: GOOD ( 32.14 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, 30 Sep 2021 14:17:06 +0100, Pingfan Liu wrote: > > When an IRQ is taken, some accounting needs to be performed to enter and > exit IRQ context around the IRQ handler. Historically arch code would > leave this to the irqchip or core IRQ code, but these days we want this > to happen in exception entry code, and architectures such as arm64 do > this. > > Currently handle_domain_irq() performs this entry/exit accounting, and > if used on an architecture where the entry code also does this, the > entry/exit accounting will be performed twice per IRQ. This is > problematic as core RCU code such as rcu_is_cpu_rrupt_from_idle() > depends on this happening once per IRQ, and will not detect quescent > periods correctly, leading to stall warnings. > > As irqchip drivers which use handle_domain_irq() need to work on > architectures with or without their own entry/exit accounting, this > patch makes handle_domain_irq() conditionally perform the entry > accounting depending on a new HAVE_ARCH_IRQENTRY Kconfig symbol that > architectures can select if they perform this entry accounting > themselves. > > For architectures which do not select the symbol. there should be no > functional change as a result of this patch. > > Signed-off-by: Pingfan Liu > Reviewed-by: Mark Rutland > Cc: "Paul E. McKenney" > Cc: Catalin Marinas > Cc: Will Deacon > Cc: Marc Zyngier > Cc: Joey Gouly > Cc: Sami Tolvanen > Cc: Julien Thierry > Cc: Thomas Gleixner > Cc: Yuichi Ito > Cc: linux-kernel@vger.kernel.org > To: linux-arm-kernel@lists.infradead.org > --- > kernel/irq/Kconfig | 3 +++ > kernel/irq/irqdesc.c | 4 ++++ > 2 files changed, 7 insertions(+) > > diff --git a/kernel/irq/Kconfig b/kernel/irq/Kconfig > index fbc54c2a7f23..defa1db2d664 100644 > --- a/kernel/irq/Kconfig > +++ b/kernel/irq/Kconfig > @@ -100,6 +100,9 @@ config IRQ_MSI_IOMMU > config HANDLE_DOMAIN_IRQ > bool > > +config HAVE_ARCH_IRQENTRY > + bool > + > config IRQ_TIMINGS > bool > > diff --git a/kernel/irq/irqdesc.c b/kernel/irq/irqdesc.c > index 4e3c29bb603c..fd5dd9d278b5 100644 > --- a/kernel/irq/irqdesc.c > +++ b/kernel/irq/irqdesc.c > @@ -693,7 +693,9 @@ int handle_domain_irq(struct irq_domain *domain, > struct irq_desc *desc; > int ret = 0; > > +#ifndef CONFIG_HAVE_ARCH_IRQENTRY > irq_enter(); > +#endif nit: I tend to prefer the 'if (!IS_ENABLED(CONFIG_*))' approach. > > /* The irqdomain code provides boundary checks */ > desc = irq_resolve_mapping(domain, hwirq); > @@ -702,7 +704,9 @@ int handle_domain_irq(struct irq_domain *domain, > else > ret = -EINVAL; > > +#ifndef CONFIG_HAVE_ARCH_IRQENTRY > irq_exit(); > +#endif > set_irq_regs(old_regs); > return ret; > } Apart from that: Reviewed-by: Marc Zyngier Thanks, M. -- Without deviation from the norm, progress is not possible. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel