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 28456C433F5 for ; Thu, 30 Sep 2021 13:17:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0B8C36187A for ; Thu, 30 Sep 2021 13:17:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350881AbhI3NTV (ORCPT ); Thu, 30 Sep 2021 09:19:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46840 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350866AbhI3NTT (ORCPT ); Thu, 30 Sep 2021 09:19:19 -0400 Received: from mail-pj1-x1029.google.com (mail-pj1-x1029.google.com [IPv6:2607:f8b0:4864:20::1029]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5FBA9C06176A for ; Thu, 30 Sep 2021 06:17:37 -0700 (PDT) Received: by mail-pj1-x1029.google.com with SMTP id rm6-20020a17090b3ec600b0019ece2bdd20so4772382pjb.1 for ; Thu, 30 Sep 2021 06:17:37 -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=+fGUHUny1dnqCh4cK/3bY76s0DaNu1CCpvmKY7qLA9w=; b=KYl65inEHkVzQxgTDgLFF4qybr2aei25/bK+XCw+F+bwkBOp2BIzmZ0JaLesk6BZgY kAWZaMVqgQawvoJF9/q/OF9Wg6d1mUqYCo9TOTt1J8uj9pWbgrweD9VgLX6PhlKi7A31 k1GHr4vHgaZ2FuDTLb4uV53S3vZpbkD0756hjLSQQ5/43kJMuH64/sfhwEDzi5N75DS7 UgmkrR4HW4JW3D6G4q+EkSS0fLuP3OjW/QGACC9RMbCv1snLqso/3udC9xMeUCk7HHpy nadNQ5YBOqw8tmROhm7+N6AZC+EPEAFvVkxZebpiC7wCIxRIUk0Upe6I5dLhhSguXYs0 /BRQ== 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=+fGUHUny1dnqCh4cK/3bY76s0DaNu1CCpvmKY7qLA9w=; b=PrV9/6SYtHCGAk56QOvtia1bTmbjUy0VljtOIaZqUpdlUWM3zMXykm8fkfXcRgGGe6 S/3C5vkjIDq8Jh0ChiuSoAFV6zEVpF3OOm3kCI0jTfRUOohZIjddIjc4ZGeAyzkBFnug JYlPKdHO8gx2j7GTlHvZYG2etiyxEpclVDSA1oXke4EHHs7/G+spjj0FnEME1H7sayVy v+36aCWfFnJWC2WkotOeDflZxADnZBWC6lU/3yDOMMVTCRhjpItFkJO4YfIEqwqGpr/g TO6zH4pHoyVM6TI3v+MeGei0WDHfVwLM6EJfBxwAzqqEXH+S6c69mPzbihvatUgqe5vD bgkQ== X-Gm-Message-State: AOAM530V43WccNt0R8W5o0MUse57qdmA9/qXko+pTfOc7xZfnmvAVYFU I6U9v42sSLoyqa96pvkpFg== X-Google-Smtp-Source: ABdhPJyX00G5w4leTEyLGDW9uTa8J4BNfFDvDwvL1ndiv78iXZ1MsJKVXB//68Zv7JN1nH6qLLXLwA== X-Received: by 2002:a17:902:7297:b0:13e:6650:a4ca with SMTP id d23-20020a170902729700b0013e6650a4camr4154634pll.37.1633007855676; Thu, 30 Sep 2021 06:17:35 -0700 (PDT) Received: from piliu.users.ipa.redhat.com ([209.132.188.80]) by smtp.gmail.com with ESMTPSA id q3sm3083167pgf.18.2021.09.30.06.17.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Sep 2021 06:17:35 -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: [PATCHv3 0/3] arm64/irqentry: remove duplicate housekeeping of rcu Date: Thu, 30 Sep 2021 21:17:05 +0800 Message-Id: <20210930131708.35328-1-kernelfans@gmail.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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. 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 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-common: supplement irq accounting arch/arm64/Kconfig | 1 + arch/arm64/kernel/entry-common.c | 48 +++++++++++++++++--------------- kernel/irq/Kconfig | 3 ++ kernel/irq/irqdesc.c | 4 +++ 4 files changed, 34 insertions(+), 22 deletions(-) -- 2.31.1 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 A7067C433F5 for ; Thu, 30 Sep 2021 13:22:45 +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 716366187A for ; Thu, 30 Sep 2021 13:22:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 716366187A 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=5w9m2r7FvJl6s0QjkwTDfSytO9n87WvC3s44mlxyRrE=; b=zTltz5LNcn83W1 gAEvfE2BOGT57IfiPW7IPm6brGcUIEVc99BxgW/eVTggXmdpUDXswoG9VCH0Js/OHVxyZGqQ2bn7D HPtzPi1WOSyT1K4F29hxTsmeFAkbXyljwNMVlE4I4elHP2V7XA/kf2Zk7oIsU1arp7TqyDk6MuJbR dPESg1MMifnC/eVbR5wmAWXgsVdeUE2S6OP1O1OESQ9PhyC/Wo6kNd3xsl3oQn+4Vt6ct049y1vya TQZWQN56shs3G6dMv7kvugkzY4HeiIY0X8ZT3RmmvajpurVsuCrqqYVWlatLKCByJ/FdtGCDdeUM+ idIo5yWzAeqPOJ2dC+EA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mVvyK-00EQGo-2w; Thu, 30 Sep 2021 13:19:36 +0000 Received: from mail-pj1-x102c.google.com ([2607:f8b0:4864:20::102c]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mVvwP-00EPa7-Vr for linux-arm-kernel@lists.infradead.org; Thu, 30 Sep 2021 13:17:40 +0000 Received: by mail-pj1-x102c.google.com with SMTP id oj16so911402pjb.1 for ; Thu, 30 Sep 2021 06:17:36 -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=+fGUHUny1dnqCh4cK/3bY76s0DaNu1CCpvmKY7qLA9w=; b=KYl65inEHkVzQxgTDgLFF4qybr2aei25/bK+XCw+F+bwkBOp2BIzmZ0JaLesk6BZgY kAWZaMVqgQawvoJF9/q/OF9Wg6d1mUqYCo9TOTt1J8uj9pWbgrweD9VgLX6PhlKi7A31 k1GHr4vHgaZ2FuDTLb4uV53S3vZpbkD0756hjLSQQ5/43kJMuH64/sfhwEDzi5N75DS7 UgmkrR4HW4JW3D6G4q+EkSS0fLuP3OjW/QGACC9RMbCv1snLqso/3udC9xMeUCk7HHpy nadNQ5YBOqw8tmROhm7+N6AZC+EPEAFvVkxZebpiC7wCIxRIUk0Upe6I5dLhhSguXYs0 /BRQ== 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=+fGUHUny1dnqCh4cK/3bY76s0DaNu1CCpvmKY7qLA9w=; b=dYSj9U2s/HGgc6cV4Lm3HjPlgByYTxnZnee9IiONQfSEl4MCs3giGm9ASE1G7aJRi/ 8kBTNYRMqx+QYLV+Q+nw3cl9jn4c/95XO8IuaieW7UIbGixlQ64Xglbz7Pc5Qt78mfgV jAQrYGZW7zmq6kX2a4dCS0dC0fGWU8JXZTVlCmGwFYVGO4soJJ5ZFoh4quC/kky56fSf oN5p4gmY+EjfYLa9FKW+b006yt7Y9+ihClx6AVS0R4JVDRCl36quWINITzz0QeHT9nxZ 0/9PVePEOFLSZ1SZFQ0ePxPFvwfaSJPCgCnLafuM/wyEaQx8PvkGsdbwWa7rUw2AT9NH IroQ== X-Gm-Message-State: AOAM531MTyb6hxxhRFfBlSJ78wMlXz1LaINqUnS/tK/PPFvY4jQkinnI Q6HO5Y/3Qn+q07K2TWPVhUrSaKZkrA== X-Google-Smtp-Source: ABdhPJyX00G5w4leTEyLGDW9uTa8J4BNfFDvDwvL1ndiv78iXZ1MsJKVXB//68Zv7JN1nH6qLLXLwA== X-Received: by 2002:a17:902:7297:b0:13e:6650:a4ca with SMTP id d23-20020a170902729700b0013e6650a4camr4154634pll.37.1633007855676; Thu, 30 Sep 2021 06:17:35 -0700 (PDT) Received: from piliu.users.ipa.redhat.com ([209.132.188.80]) by smtp.gmail.com with ESMTPSA id q3sm3083167pgf.18.2021.09.30.06.17.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Sep 2021 06:17:35 -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: [PATCHv3 0/3] arm64/irqentry: remove duplicate housekeeping of rcu Date: Thu, 30 Sep 2021 21:17:05 +0800 Message-Id: <20210930131708.35328-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-20210930_061738_077740_88837B54 X-CRM114-Status: GOOD ( 14.17 ) 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 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. 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 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-common: supplement irq accounting arch/arm64/Kconfig | 1 + arch/arm64/kernel/entry-common.c | 48 +++++++++++++++++--------------- kernel/irq/Kconfig | 3 ++ kernel/irq/irqdesc.c | 4 +++ 4 files changed, 34 insertions(+), 22 deletions(-) -- 2.31.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel