From patchwork Fri Sep 24 13:28:32 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pingfan Liu X-Patchwork-Id: 12515509 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.8 required=3.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1E0C1C433EF for ; Fri, 24 Sep 2021 13:30:52 +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 D9C9060F4C for ; Fri, 24 Sep 2021 13:30:51 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org D9C9060F4C 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=5ExmRCdG0uMe68xdd2wM7LmSKvhkZHysUZDQaPzJlDE=; b=h6UBfwpgmeNkUa FEu9XEWQ9qYXl5QVKpzM1xuTxoHhjEx7MKWG0y9anXZQsciobXIHzo8JJ57EOi5EkS5ckWqrFAWJM BMIwipID6a7vCrIB1nXbkl6N7NBY2t4BZof9qE71A+RSRbKsdqCkN6qhDRMFe2Wx/mf5Zbc/eUpM6 EDwkh3Mmo3f+a9VYYuSiHGFMmhBFwyX9FKCQxGcz7FH4Bf9my7YFn3lnY8XnymHDUZIcRjq6J3n/H pkEsB3nd/sRJswX73c0RbVz753dH3v4l+yu4z/DYkPKaQDhbZ42MW+XBkmzLsyFGXSETGrWDv4a6F c1PSNqnEwHv4rTpqQC6w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mTlGD-00EacO-FP; Fri, 24 Sep 2021 13:29:05 +0000 Received: from mail-pf1-x436.google.com ([2607:f8b0:4864:20::436]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mTlG3-00Eaa4-3E for linux-arm-kernel@lists.infradead.org; Fri, 24 Sep 2021 13:28:56 +0000 Received: by mail-pf1-x436.google.com with SMTP id m26so8911147pff.3 for ; Fri, 24 Sep 2021 06:28:54 -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=bp1QhDTRs5+iIrkEymnf+wtmNaVnCHkCBBZigTiyxqc=; b=DjZI8Pwzt3OkpHorB5kvWv1DXeyXMYWUeeLxJvzd8WvJrGtWMX6Y0HAisoL8YjwC7e 13DBSmsAg4r7wJlUkJD68+Pb+1Do3sirrcn1fP19PLRNUfPfXTXu2Gd+Sl2k5NVnPG8o cOjByLZK9sIZ6XgFGuVxSB4grcruSsHmjXSInYwqwV8XZmKmh3gXZvDKT3it/1ucDXE5 CMkNH7DoR0Gz6JrLlgZgd7wkk2k7dBqN94orz0MDp67GWF1J2SXTeAb+PFcFZPcFrgmj 6Gp3RfXz5Zg+KaAoJFYNNX3++ga0JEbxajTDVOjK6ue5wsezL84mgKpZedjRBtu/tLKt ed2Q== 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=bp1QhDTRs5+iIrkEymnf+wtmNaVnCHkCBBZigTiyxqc=; b=fgUkA5Yr3B6rBlHgV6NaRTqXU04UsgEJlGPtReV8E52T1aG/b0AHM3PKVntBm7Et1R VO7YLT29aQCiMUJjv2jA7lWH49u79WkDmgR/I+I7lrgMm36v12aroFgszFlg1iVgRlBk syKAgfDnduLkds5amyMi9Ju1Wgts0fE5Qe4VT9D86/4n7ZqlqpmgqK+iafby9SH3OAK9 BQfj+3bn8rSwBIkjI9aSDDNDDRmGGr9zE4uXOY1g6fiuQmc4FdMOK5bQIGbbuCxdVHJr rxef5KlpnKg83buzLsHZDIjw5iRIQIZ3ATznIQ5n+zGgQSRU4G8DLGq/S5jMQG8jNjM0 kRwA== X-Gm-Message-State: AOAM530BqdxVWfLCs/jduszio5cu3d6E1FQ1hTFW8IdpfklWomch19Rs 6i4dGXyVbIkfS3pNcklgXI4qfbgJeA== X-Google-Smtp-Source: ABdhPJyEtAq+e5WMvP9Nyi+DR0/To34+31ApTR0KVDKgfaJeXLAi6DKATboOAWu95m16Gi4O6bvBZA== X-Received: by 2002:a63:f050:: with SMTP id s16mr3793900pgj.258.1632490133628; Fri, 24 Sep 2021 06:28:53 -0700 (PDT) Received: from piliu.users.ipa.redhat.com ([209.132.188.80]) by smtp.gmail.com with ESMTPSA id 26sm11756573pgx.72.2021.09.24.06.28.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Sep 2021 06:28:53 -0700 (PDT) From: Pingfan Liu To: linux-arm-kernel@lists.infradead.org Cc: Pingfan Liu , Catalin Marinas , Will Deacon , Mark Rutland , Marc Zyngier , Joey Gouly , Sami Tolvanen , Julien Thierry , Thomas Gleixner , Yuichi Ito , linux-kernel@vger.kernel.org Subject: [PATCHv2 0/5] arm64/irqentry: remove duplicate housekeeping of Date: Fri, 24 Sep 2021 21:28:32 +0800 Message-Id: <20210924132837.45994-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-20210924_062855_188353_D3D9E899 X-CRM114-Status: GOOD ( 12.27 ) 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 After introducing arm64/kernel/entry_common.c which is akin to kernel/entry/common.c , the housekeeping of rcu/trace are done twice as the following: enter_from_kernel_mode()->rcu_irq_enter(). And gic_handle_irq()->...->handle_domain_irq()->irq_enter()->rcu_irq_enter() Besides redundance, based on code analysis, the redundance also raise some mistake, e.g. rcu_data->dynticks_nmi_nesting inc 2, which causes rcu_is_cpu_rrupt_from_idle() unexpected. Nmi also faces duplicate accounts. This series aims to address these duplicate issues. [1-2/5]: address nmi account duplicate [3-4/5]: address rcu housekeeping duplicate in irq [5/5]: as a natural result of [3-4/5], address a history issue. [1] History: v1 -> v2: change the subject as the motivation varies. add the fix for nmi account duplicate The subject of v1 is "[PATCH 1/3] kernel/irq: __handle_domain_irq() makes irq_enter/exit arch optional". [2] It is brought up to fix [1]. There have been some tries to enable crash-stop-NMI on arm64, one by me, the other by Yuichi's [4]. I hope after this series, they can advance, as Marc said in [3] "No additional NMI patches will make it until we have resolved the issues" [1] https://lore.kernel.org/linux-arm-kernel/87lfewnmdz.fsf@nanos.tec.linutronix.de/ [2] https://lore.kernel.org/linux-arm-kernel/1607912752-12481-1-git-send-email-kernelfans@gmail.com [3] https://lore.kernel.org/linux-arm-kernel/afd82be798cb55fd2f96940db7be78c0@kernel.org [4] https://lore.kernel.org/linux-arm-kernel/20201104080539.3205889-1-ito-yuichi@fujitsu.com 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 Pingfan Liu (5): arm64/entry-common: push the judgement of nmi ahead irqchip/GICv3: expose handle_nmi() directly kernel/irq: make irq_{enter,exit}() in handle_domain_irq() arch optional irqchip/GICv3: let gic_handle_irq() utilize irqentry on arm64 irqchip/GICv3: make reschedule-ipi light weight arch/arm64/Kconfig | 1 + arch/arm64/include/asm/irq.h | 7 ++++ arch/arm64/kernel/entry-common.c | 45 +++++++++++++++------- arch/arm64/kernel/irq.c | 29 ++++++++++++++ drivers/irqchip/irq-gic-v3.c | 66 ++++++++++++++++++++------------ kernel/irq/Kconfig | 3 ++ kernel/irq/irqdesc.c | 4 ++ 7 files changed, 116 insertions(+), 39 deletions(-)