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 D1595C433F5 for ; Fri, 1 Oct 2021 14:33:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id AD06861A50 for ; Fri, 1 Oct 2021 14:33:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1354377AbhJAOfQ (ORCPT ); Fri, 1 Oct 2021 10:35:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54806 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231679AbhJAOfP (ORCPT ); Fri, 1 Oct 2021 10:35:15 -0400 Received: from mail-pj1-x1033.google.com (mail-pj1-x1033.google.com [IPv6:2607:f8b0:4864:20::1033]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 68C78C061775 for ; Fri, 1 Oct 2021 07:33:30 -0700 (PDT) Received: by mail-pj1-x1033.google.com with SMTP id v19so6671197pjh.2 for ; Fri, 01 Oct 2021 07:33:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=K6bdrW5XoTNbCZ8Y3lTAFsO0+u7qGnbAjtCOYBFB05Y=; b=AiFU1M2LcJHiomhxlBGqFJ7n2sKalQZc2fRuZQN1uEiRkm1inHkPTxsB3ntoWTjy1Y +p6HLCfW0nwMEvk50/hcySMzbeq3r5RI/zlmsKGtyUPsY1bvHK3x2yjQ07VKNFtR8blL qveh2UKlo2knoRKMuyfSwzKMPdgI4lFwhlST5cuz7tSmQuhqO37kqrX20Lo0h6OI/yW6 qvtR7+K7TYIzEtzBeP2XqBrbA6LdJIYPA8j6cgmy+STO9drdnto2HcJrHQQEThlrWxnW /l2pTuais3nkopujnSUqoNiOYKfs+o6fA8z+mSh1X0eNXleKo9oThw9vLIChDByCA5uZ wO+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=K6bdrW5XoTNbCZ8Y3lTAFsO0+u7qGnbAjtCOYBFB05Y=; b=h1fDyvYWmwwBdqcY1BDrv8iSZFAD2RiXLhRi/o7QYRMtoV6ZQIG7bZNun2QgMHW7cz npxT0KiJOOUdmnkDl21w8nP/sMH42EYuGcwj6k4jfLVb2wsWTX1mqA+f2D9gJwXIzflo F4O9PR1LAqbHtsQDuxLEizzBwuFqYYY267ye4IFWv/Lh54qLb6rKd9vtFz2+DxXh76+Y ZWOKcW6J8p3XapCuu/CKQqn+Ye0Iap/tBvjYfeRn5OzRLuaP9MgizpCzsIwCY79FBo1O phygUMfjFKqFyQYHoAO+TOFKm9s12JoyTPRavgUat26bkrCgcxKRMHDaM8V6tvZQbeyk 84lg== X-Gm-Message-State: AOAM5319AVeEnIPZXA77E0zkUQ2SRdZa8U4HPylnhOe6hpxRMg7IrCYl +6NadZMAbsgz2QeUckUnUw== X-Google-Smtp-Source: ABdhPJwg1gAthTPyUbT6um3Zi17pDErx0CVbMnwMjrO5y0xoDVke0Zyy1kTTTmFTB09BBQKFT26T5w== X-Received: by 2002:a17:902:7613:b0:13d:b35f:b4d7 with SMTP id k19-20020a170902761300b0013db35fb4d7mr11418893pll.8.1633098809959; Fri, 01 Oct 2021 07:33:29 -0700 (PDT) Received: from piliu.users.ipa.redhat.com ([209.132.188.80]) by smtp.gmail.com with ESMTPSA id d19sm4678497pfl.67.2021.10.01.07.33.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Oct 2021 07:33:29 -0700 (PDT) Date: Fri, 1 Oct 2021 22:33:22 +0800 From: Pingfan Liu To: Marc Zyngier 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 Message-ID: References: <20210930131708.35328-1-kernelfans@gmail.com> <20210930131708.35328-2-kernelfans@gmail.com> <87sfxlrtqz.wl-maz@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87sfxlrtqz.wl-maz@kernel.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Oct 01, 2021 at 10:15:16AM +0100, Marc Zyngier wrote: > 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. > I check the irqdesc.c, the other macro conditional statements have the style "#ifdef". So if using 'if (!IS_ENABLED(CONFIG_*))', the file looks a little disharmony. > > > > /* 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 > I am not sure whether you agree with my opinion about the style of macro and hesitate to include your Reviewed-by. Could you kindly give your Reviewed-by to my V4, if it is OK for you? Thanks Pingfan 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 8EC1EC433EF for ; Fri, 1 Oct 2021 14:35:37 +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 56F3E61A40 for ; Fri, 1 Oct 2021 14:35:37 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 56F3E61A40 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com 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:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=oaSlOq+vUfCWLtMcO3dS+2Yc4kbVyv2O1EO7XW24cxs=; b=e1uFh5NGJhQUUc dLRk66FpgTuMJ8T1tBXBUjqlculq5LD3xM4OFer42PzKr0gD5ca0Bk8CtszUk+zhzI2loDFLwwtge FGa6a0Zo/Mb5zFx3AR8phSmxFaMGufEnqo90MOpqAqCpNhtqEM49ZuRVJrpVSapTtUPRpEjtPs4bA EGRsYECDYlU/O6vqw2tnlyd04FDlu1Yt1bnHJnIg4+s3oIOM3A0LqAFK0psout/5RZVlvN76rWpGV Fpujv1B3HSIQ5pzRsQ5mO+UaXLxeWBH31GfNoOebOxzkTdu6WS4sPQ5j383nzZogb1YD2SYax20mL lS13tTervQjWErybblUQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mWJbS-000Xnu-T0; Fri, 01 Oct 2021 14:33:35 +0000 Received: from mail-pj1-x1034.google.com ([2607:f8b0:4864:20::1034]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mWJbP-000XnL-Ul for linux-arm-kernel@lists.infradead.org; Fri, 01 Oct 2021 14:33:33 +0000 Received: by mail-pj1-x1034.google.com with SMTP id np13so427876pjb.4 for ; Fri, 01 Oct 2021 07:33:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=K6bdrW5XoTNbCZ8Y3lTAFsO0+u7qGnbAjtCOYBFB05Y=; b=AiFU1M2LcJHiomhxlBGqFJ7n2sKalQZc2fRuZQN1uEiRkm1inHkPTxsB3ntoWTjy1Y +p6HLCfW0nwMEvk50/hcySMzbeq3r5RI/zlmsKGtyUPsY1bvHK3x2yjQ07VKNFtR8blL qveh2UKlo2knoRKMuyfSwzKMPdgI4lFwhlST5cuz7tSmQuhqO37kqrX20Lo0h6OI/yW6 qvtR7+K7TYIzEtzBeP2XqBrbA6LdJIYPA8j6cgmy+STO9drdnto2HcJrHQQEThlrWxnW /l2pTuais3nkopujnSUqoNiOYKfs+o6fA8z+mSh1X0eNXleKo9oThw9vLIChDByCA5uZ wO+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=K6bdrW5XoTNbCZ8Y3lTAFsO0+u7qGnbAjtCOYBFB05Y=; b=qgfzt/C3xturSH0GohWfFfrQqdgITwRYId0SwONWGovDhHqJuc1P60n71/HuceKAmT 3bGK2hCWRWE2qZF3kURwFPU/oNfIHkmMPBfQUmm6Udhv/+It+NP77pkn4WX3lWvy6644 w8ZC69RMaJwvlRJVKeVIrpGKk6qGPtaFNQuvz2xHJCpvmU0QN8lfWURMRH4bIkURa1HV VyvQuUtATcDMEfQgqWoVsoxJC2KCVKQ2H/InyNnqivsfv2pi8O7vlcbAXq8Tm6DTFwNs 9djSJTkzEJLRJbRMn3I4qUJxf86G+nNdKgFDSz5VMdnKR0cKDTFIlvo/K0O62uTsZMaI YmcA== X-Gm-Message-State: AOAM533xFSyc+NIBpWZgjSNuWVjtAoniExtKDjrJhfXlf3SgkpET2Nik 1mitxCp1f2HWbzK824A85A== X-Google-Smtp-Source: ABdhPJwg1gAthTPyUbT6um3Zi17pDErx0CVbMnwMjrO5y0xoDVke0Zyy1kTTTmFTB09BBQKFT26T5w== X-Received: by 2002:a17:902:7613:b0:13d:b35f:b4d7 with SMTP id k19-20020a170902761300b0013db35fb4d7mr11418893pll.8.1633098809959; Fri, 01 Oct 2021 07:33:29 -0700 (PDT) Received: from piliu.users.ipa.redhat.com ([209.132.188.80]) by smtp.gmail.com with ESMTPSA id d19sm4678497pfl.67.2021.10.01.07.33.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Oct 2021 07:33:29 -0700 (PDT) Date: Fri, 1 Oct 2021 22:33:22 +0800 From: Pingfan Liu To: Marc Zyngier 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 Message-ID: References: <20210930131708.35328-1-kernelfans@gmail.com> <20210930131708.35328-2-kernelfans@gmail.com> <87sfxlrtqz.wl-maz@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <87sfxlrtqz.wl-maz@kernel.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211001_073332_025675_D4C80C6E X-CRM114-Status: GOOD ( 34.35 ) 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 Fri, Oct 01, 2021 at 10:15:16AM +0100, Marc Zyngier wrote: > 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. > I check the irqdesc.c, the other macro conditional statements have the style "#ifdef". So if using 'if (!IS_ENABLED(CONFIG_*))', the file looks a little disharmony. > > > > /* 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 > I am not sure whether you agree with my opinion about the style of macro and hesitate to include your Reviewed-by. Could you kindly give your Reviewed-by to my V4, if it is OK for you? Thanks Pingfan _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel