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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 06117C54798 for ; Thu, 7 Mar 2024 18:57:16 +0000 (UTC) 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=I8O7Mm4HxKA5A05FhtMD65wcA0EMz03eeNlJJvJh8Ys=; b=D313fBFgyKV743 rHWVGg5GPb64F/5+f3Q7BHeUuJPl27v6eir0X9Q+s6kZqD6OPHB+xm5xKpHnDDHte0OtqfEd0B/bx liRBLN8aKOJ1m1l+uCMpkkHtf25aubzBa66tc0fwSSPV+XCirlGtHVe1ItwmH+wKXYXcYq0qETGQ9 VShwQ4qI3Dl2MBbJkKBPAy476I7m6MsG+9Q32cBWlBr2+ZDg2uwOO0Hq63ainig0rlGsgzMFQRfbk EFlHGr6KgQTFa/w4O4E7VOMFRjFZxm6oWzRW2YORq5Qesofgyaf5bg42GfW3JnFDT6Q21FIR0Tufk /DeWLGYZKq392hVuVvnA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1riIvQ-00000005wtU-2ijd; Thu, 07 Mar 2024 18:57:04 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:32c8:5054:ff:fe00:142]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1riIvM-00000005wW6-2SOD for linux-arm-kernel@lists.infradead.org; Thu, 07 Mar 2024 18:57:03 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=NR0+Ie0LOl2eewPVHgTlvTXz4AW9q3B2J0v5cGLbxHY=; b=cESIAX3TafAWzXQgvkAgIo8lVm ggFPD0RsJ0CkCIvZY2t6emcF/qxlOiKgwtIJdGKDK5LugTyeTR3AMMwHNuseATbCjJBvgMHFUrcQ/ +ol7BBfdRyWO+vFREBHq38pLTcxosZYvtGKxUrIEsrnRevpTezae1P4Y3cQ6TOpA9hBXruy2k1dpQ xkO5e3U5HJwm0GDlWQ1i2kj4sIvVPzPUI6fVrztiPxORFN5JeHtBaivSczwMtSKOYfWDn26KD22rv 9PXxU7mmEzWhCG9jowBSw3gFeyZRIjZ3bx2a62RoBhfT9YdPkginRF95MOCF8M92o265gt+FmQX0A JFDAcvVw==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:37862) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1riIt9-0001cn-0x; Thu, 07 Mar 2024 18:54:43 +0000 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1riIt4-0007SD-PX; Thu, 07 Mar 2024 18:54:38 +0000 Date: Thu, 7 Mar 2024 18:54:38 +0000 From: "Russell King (Oracle)" To: "Paul E. McKenney" Cc: Stefan Wiehler , Joel Fernandes , Josh Triplett , Boqun Feng , Steven Rostedt , Mathieu Desnoyers , Lai Jiangshan , Zqiang , linux-arm-kernel@lists.infradead.org, rcu@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] arm: smp: Avoid false positive CPU hotplug Lockdep-RCU splat Message-ID: References: <20240307160951.3607374-1-stefan.wiehler@nokia.com> <49792f54-fa11-4984-8611-84ba640a2b86@paulmck-laptop> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <49792f54-fa11-4984-8611-84ba640a2b86@paulmck-laptop> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240307_105700_798177_B7D8374F X-CRM114-Status: GOOD ( 17.22 ) 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 Thu, Mar 07, 2024 at 09:45:36AM -0800, Paul E. McKenney wrote: > > diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c > > index 3431c0553f45..6875e2c5dd50 100644 > > --- a/arch/arm/kernel/smp.c > > +++ b/arch/arm/kernel/smp.c > > @@ -319,7 +319,14 @@ void __noreturn arch_cpu_idle_dead(void) > > { > > unsigned int cpu = smp_processor_id(); > > > > + /* > > + * Briefly report CPU as online again to avoid false positive > > + * Lockdep-RCU splat when check_and_switch_context() acquires ASID > > + * spinlock. > > + */ > > + rcutree_report_cpu_starting(cpu); > > idle_task_exit(); > > + rcutree_report_cpu_dead(); > > > > local_irq_disable(); > > Both rcutree_report_cpu_starting() and rcutree_report_cpu_dead() complain > bitterly via lockdep if interrupts are enabled. And the call sites have > interrupts disabled. So I don't understand what this local_irq_disable() > is needed for. I think that's a question for this commit: commit e78a7614f3876ac649b3df608789cb6ef74d0480 Author: Peter Zijlstra Date: Wed Jun 5 07:46:43 2019 -0700 Before this commit, arch_cpu_idle_dead() was called with IRQs enabled. This commit moved the local_irq_disable() before calling arch_cpu_idle_dead() but it seems no one looked at the various arch implementations to clean those up. Quite how arch people are supposed to spot this and clean up after such a commit, I'm not sure. The local_irq_disable() that you're asking about has been there ever since the inception of SMP on 32-bit ARM in this commit: commit a054a811597a17ffbe92bc4db04a4dc2f1b1ea55 Author: Russell King Date: Wed Nov 2 22:24:33 2005 +0000 Where cpu_die() was later renamed to arch_cpu_idle_dead(). So it's purely a case of a change being made to core code and arch code not receiving any fixups for it. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last! _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel