Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp227931pxb; Tue, 28 Sep 2021 20:18:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzH2SPziWyZWUFX20wJza/lelqxVTP/8GH60NSFdx2HqcBJajniA2mF7Gq3+iN7X9CKkev1 X-Received: by 2002:a17:907:1c01:: with SMTP id nc1mr11369918ejc.504.1632885533927; Tue, 28 Sep 2021 20:18:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632885533; cv=none; d=google.com; s=arc-20160816; b=Wsnrxm6wx+CLKdOma94mu2mRwTcbW4947kRzT6fMsJu9V+xSuz2UeHrq/1Iifhmc9P AmbXvkBRexgh6EQwT1YJgmd+D3Y5y7vF57veZUdDoZpIvOL7uj0QmD+PJU3ZTGzsHwcE 6eFatS8dQOs9DGaa0asWwClLRdGYGGclRHXzA2nTRHueyd06jTGnU/1l4tZZhnphOZLC Bws6/JU5nFBGmOzYb0vCWSzVweT93ezio1R2aCNy2gu63feUsoqxVAfi+wM5rGHb4bji kTiC1vHK8QwkJoiaFw2gYK8+a2Uk/YpGMfIKKDCkAdSd3VRfoZF7nQSCJguHXnLgYcwO un8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=VYUwZTajBKG73N6boXA2eLFqYW6+o4P9ejOOh0bWbFg=; b=S95signacWwod7ZrUZ2/+cXvpV4jLloZDnOaJ8t7YrzAiN5quTnqupB8IYgOM9iXH1 419UZQFQmm6XZ/Ete02SvZsWV9Vy0TcTsALTjmgL7MLsBdX6ivu8aWdtqEa4Fg4fM15B VEVvwtFwTqELQR8jF9yxiKOSKCeFcMcD6LxbRy+6eM5ncH/sGz9h1bo7JwB3+NGHXlLA L2vUSR6F0jLi/hCJ1eNq18TaR1xf4M6CHfQnsV0l4hZZzzvtwHQitIIpkaPdunOuNlPl 9pSEHbL6xncAh0ffz9vnS0BzLrszKiAOX4nz63UEB2pbnsRwmPBGlPR7dz0rQm8eXcfD xUww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ET73G2qC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dz10si556887edb.412.2021.09.28.20.18.29; Tue, 28 Sep 2021 20:18:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ET73G2qC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243811AbhI2DRI (ORCPT + 99 others); Tue, 28 Sep 2021 23:17:08 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:55793 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230022AbhI2DRH (ORCPT ); Tue, 28 Sep 2021 23:17:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1632885325; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=VYUwZTajBKG73N6boXA2eLFqYW6+o4P9ejOOh0bWbFg=; b=ET73G2qCnst0nmmX3AH9O7U/jWwbZuxNKq1vh9seY1o4vJMAkghZQEcuiLNRNTHVx4Y5iG TlxvqhmT+IuE/XZtst2vdNq5CsvOkEYjEH7x+ZGIJVrFI4Ty/mtYVv7CX9xEvt+ksquoMt ArH/ruR5Diz7CcLK70/B2eIKg3Q8nB4= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-30-4BAQyUcGPhy24kJMwOxdew-1; Tue, 28 Sep 2021 23:15:22 -0400 X-MC-Unique: 4BAQyUcGPhy24kJMwOxdew-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4EEBE1084687; Wed, 29 Sep 2021 03:15:20 +0000 (UTC) Received: from piliu.users.ipa.redhat.com (ovpn-8-24.pek2.redhat.com [10.72.8.24]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 45EE060583; Wed, 29 Sep 2021 03:15:13 +0000 (UTC) Date: Wed, 29 Sep 2021 11:15:09 +0800 From: Pingfan Liu To: Mark Rutland Cc: Pingfan Liu , linux-kernel@vger.kernel.org, Thomas Gleixner , Catalin Marinas , Will Deacon , Marc Zyngier , Joey Gouly , Sami Tolvanen , Julien Thierry , Yuichi Ito , linux-arm-kernel@lists.infradead.org Subject: Re: [PATCHv2 3/5] kernel/irq: make irq_{enter,exit}() in handle_domain_irq() arch optional Message-ID: References: <20210924132837.45994-1-kernelfans@gmail.com> <20210924132837.45994-4-kernelfans@gmail.com> <20210928085500.GC1924@C02TD0UTHF1T.local> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210928085500.GC1924@C02TD0UTHF1T.local> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Sep 28, 2021 at 09:55:00AM +0100, Mark Rutland wrote: > On Fri, Sep 24, 2021 at 09:28:35PM +0800, Pingfan Liu wrote: > > handle_domain_irq() contains two major parts: > > -1. irq_enter()/irq_exit(), which serves as hooks for rcu and trace etc. > > -2. irq mapping and dispatching > > > > After the introduction of irqentry_enter()/irqentry_exit() and arch > > specific counterpart (e.g. arm64), roughly speaking, rcu_irq_enter() has > > already been called. Hence here comes requirement to move > > irq_enter/irq_exit out of handle_domain_irq(). And arches should handle > > about irq_enter_rcu()/irq_exit_rcu() by themself. > > > > Since there is still arches, which does not adopt irqentry_enter(), let > > irq_enter()/irq_exit() arch optional in handle_domain_irq(). > > The patch below looks good to me, but the commit message is a little > hard to follow. How about: > > 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. > Thanks for your precious time to improve the log. It looks great, and I will use it in V2. I will keep learning to improve my level of log. > With that commit message: > > Reviewed-by: Mark Rutland > Thanks, Pingfan