From patchwork Fri Oct 1 14:44:03 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pingfan Liu X-Patchwork-Id: 12530757 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 E57B2C433F5 for ; Fri, 1 Oct 2021 14:46:58 +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 A5B9F6136A for ; Fri, 1 Oct 2021 14:46:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org A5B9F6136A 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:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=dVyz4qjUyCqXJXk5z+MSbkzz15uXiNM5o4sqoI1BcX0=; b=VbmBd7SInAhEHX zsz1qbTWidifGoKDAlPTNjscXpRJWqkMpwKUJdh77pXNrcpQv6F4irntMa4a5BccvGSuijuBVVf+I 3iPyN3kUQdxPLPW7c1FKt4M8CRnL52qxDU5cFJP5pdODO2NJ4KOzrBOVBAiqVSROQRD9zXAMGcF/Y RE6PLLoqK2XIG9ayuP8CyS6mWAO2VIaDHZbGCsF3kTMkRnrCamAu+DmXiRe4hLA3Sxo/7o9BNiCF9 2z7YS8LfNO+mwOfZV86FKQwufD4J8TNnipa7l0GUUkg7LMwEOjGaRIwIQpOuLt8VjkrxyfY6diozu gxYFigy41ULEWbs0ufRA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mWJm0-000bSn-Ah; Fri, 01 Oct 2021 14:44:28 +0000 Received: from mail-pl1-x632.google.com ([2607:f8b0:4864:20::632]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mWJlw-000bRy-6j for linux-arm-kernel@lists.infradead.org; Fri, 01 Oct 2021 14:44:25 +0000 Received: by mail-pl1-x632.google.com with SMTP id l6so6436280plh.9 for ; Fri, 01 Oct 2021 07:44:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=OrwI+1G/Gss3+VMz15ISVKMli2WYOzWcM/vEGb1Xumk=; b=ckejzGSZzH+3Bo4fswwZYcDFcARseZJdNbqbuwe8fPc3PD7RnJmK2+OEprjI/xubzo ZNbPQaojLdEeCA3VBK5x9Ky8B+w9lzocR5Lv75fn8EBvy7k4iUgR7cIhX0G8g0E2h9Nb bo3fqTHHQGCnd/j+5+TMTk/v7pf9U5QFdXWPVb4UYU1gnEHrfzHJPbNqgqZjJBTxOdIc efJXUXa6NvuilGCXjBN/qHgEDkePd2Jepj87bkGFAAeFWgd4aQVznN2AJ+V3riD7AKxj EnDcIuiGtS1iCMy5EiYJnRSFQL7Xv7LxV5UVQPfXerWYsMk9D+iX/uDkIKHASPVbNtYE 3zNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=OrwI+1G/Gss3+VMz15ISVKMli2WYOzWcM/vEGb1Xumk=; b=5AflVEQ+zpc7YdRUfQsuJSy1lSjqhLTRVmdHMlOI8GwOaqDBVMcpqXUsxIxliZtaQk JPdgcMIV2QG9tVfiw6kznhpYwnSPihg0Gu7nz3qPrW7gd4Jq/NN9hCS9SgRqasc+6XQB fVjKWcSxmboSnkUsXYLWy/P5pD6a+kxvi/GndMJwJAkFdW/NwZxLNq6IGI/oti8Shpts L84DM+knabUZDOUKdkODahbN3tWv+ZcWUni2cZUdXK5ZkZApy9NhGX54+PxKvjpfdWy/ zI/xUM1KnNZWeozUdkauNGcCUZQgFUy9UPpKwWpPmVIi/v9Qo+r/t/PNoaIytFiAGm84 wWEA== X-Gm-Message-State: AOAM532nc5Yz/fTe+oYkTMHNfIBahCjIclowdFs9FCag/F7nneNcHM0o WTjDI6MUuqhOcmiTdPb+a54bSxzdIg== X-Google-Smtp-Source: ABdhPJzDEJ19JcXUSL4AUXL4PYOgS4p63f9Mhnc+elBqRZXvUSmtwCcOxDZo6emhTGGhzQoTbmYVdQ== X-Received: by 2002:a17:902:ab4b:b0:13e:932e:f65 with SMTP id ij11-20020a170902ab4b00b0013e932e0f65mr510659plb.58.1633099461514; Fri, 01 Oct 2021 07:44:21 -0700 (PDT) Received: from piliu.users.ipa.redhat.com ([209.132.188.80]) by smtp.gmail.com with ESMTPSA id z12sm6766203pge.16.2021.10.01.07.44.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Oct 2021 07:44:21 -0700 (PDT) From: Pingfan Liu To: linux-arm-kernel@lists.infradead.org Cc: Pingfan Liu , "Paul E. McKenney" , Catalin Marinas , Will Deacon , Mark Rutland , Marc Zyngier , Joey Gouly , Sami Tolvanen , Julien Thierry , Thomas Gleixner , Yuichi Ito , linux-kernel@vger.kernel.org Subject: [PATCHv4 0/3] arm64/irqentry: remove duplicate housekeeping of rcu Date: Fri, 1 Oct 2021 22:44:03 +0800 Message-Id: <20211001144406.7719-1-kernelfans@gmail.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211001_074424_270175_4A49A98E X-CRM114-Status: GOOD ( 14.40 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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. V3 -> V4: address Signed-off-by in [2/3] improve commit log in [3/3] V2 -> V3: Drop other patches and concentrate on the purpose of [3-4/5] of V2. And lift the level, where to add {irq_enter,exit}_rcu(), from the interrupt controler to exception entry History: V1: https://lore.kernel.org/linux-arm-kernel/1607912752-12481-1-git-send-email-kernelfans@gmail.com V2: https://lore.kernel.org/linux-arm-kernel/20210924132837.45994-1-kernelfans@gmail.com V3: https://lore.kernel.org/linux-arm-kernel/20210930131708.35328-1-kernelfans@gmail.com Cc: "Paul E. McKenney" Cc: Catalin Marinas Cc: Will Deacon Cc: Mark Rutland 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 Mark Rutland (1): arm64: entry: refactor EL1 interrupt entry logic Pingfan Liu (2): kernel/irq: make irq_{enter,exit}() in handle_domain_irq() arch optional arm64: entry: avoid double-accounting IRQ RCU entry arch/arm64/Kconfig | 1 + arch/arm64/kernel/entry-common.c | 47 +++++++++++++++++--------------- kernel/irq/Kconfig | 3 ++ kernel/irq/irqdesc.c | 4 +++ 4 files changed, 33 insertions(+), 22 deletions(-)