Received: by 2002:ab2:3319:0:b0:1ef:7a0f:c32d with SMTP id i25csp82361lqc; Thu, 7 Mar 2024 10:55:06 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVA0jb7FFxbQBv0H+e95iLXQaQ6CHn7+OzLFU8Ngb3I3ghNGwd5yFMh77cIPgsgiEp4Y7WIg4rziLysluMHf+UswASPQIXxsSvXo9iKWw== X-Google-Smtp-Source: AGHT+IGWNgAeNxQKxswsi5E5bSCHAydIkcaq21Nendzal+WiMOJhPL5Or3+NbCw8ms5sIQJlWND1 X-Received: by 2002:a17:902:9304:b0:1dd:611d:3be3 with SMTP id bc4-20020a170902930400b001dd611d3be3mr1271005plb.17.1709837706066; Thu, 07 Mar 2024 10:55:06 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709837706; cv=pass; d=google.com; s=arc-20160816; b=NnBl+FzSRPUQZcoxfqm1CW5VuSD8h7JukwE4Rm+I9NxLKJImHnk9YHP/BMhT/fB0uJ bnaxQ44JJpOvOFzyASwj8glsuLM7c2CSzww3G6WJM1JSvYk4dVibEHv3sdb4WT8aYxez XoBEmrMLAjYoyhYry65y9Am3jHxk+C7uHJgrtcZNWlI3MZX9Eu9CGSUqiXuqJdcovkDT SB+M4+sgCK0mbjRcg4JqG4dPC6PfdNifCx38+VD55jltVXbpLwbzSJuA7l3ZgbyfgngN msa+MUOHuiC/uljorGAOyZq3i6MgsxHCpBhRCW5ZD+Gp4F7+C4hqw65AhNcXxuKMHTQk O+dg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:in-reply-to:content-disposition:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:references :message-id:subject:cc:to:from:date:dkim-signature; bh=NR0+Ie0LOl2eewPVHgTlvTXz4AW9q3B2J0v5cGLbxHY=; fh=IGVp9wFB2TzAgYG70FWP0VJ3+EFNihfpFUEoCyYkTaY=; b=qh99MzC1rKuHpfkGFXwmbir4cjfuIcsxEAGfyxBdCTnAWZApShCgZYAG/xrGn1Aaso z44M06zi8AJPXjbSxTV3PQ8F4mow4XHD7pcvnigdR6IiKuwKhlvMatohwBI0Lm+LTPNP w8Cv/QRkTeWahA5S7UurTzMqaPgIIxgr9sUhB2v40a4nTJZP8dO7N1vnzy+8op2Dlpap qrkZWCwv+K5mKYXPYyMcM0w25ssdXpkEdNT0fXj/StruXVolBtLmsgrtC5rpzYVf8KRi 6aeCRiiJx6ZChlPl2F1FeRhb76cDBy6pwxdudmOvWFAuQFL86U1AQiA1efkliXZyVeIw vLgQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=cESIAX3T; arc=pass (i=1 dkim=pass dkdomain=armlinux.org.uk dmarc=pass fromdomain=armlinux.org.uk); spf=pass (google.com: domain of linux-kernel+bounces-96041-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-96041-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id bf5-20020a170902b90500b001dd5f7a9e9asi864176plb.437.2024.03.07.10.55.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Mar 2024 10:55:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-96041-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=cESIAX3T; arc=pass (i=1 dkim=pass dkdomain=armlinux.org.uk dmarc=pass fromdomain=armlinux.org.uk); spf=pass (google.com: domain of linux-kernel+bounces-96041-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-96041-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id B963028255E for ; Thu, 7 Mar 2024 18:55:05 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 69B4D135A46; Thu, 7 Mar 2024 18:55:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b="cESIAX3T" Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [78.32.30.218]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A353612B143; Thu, 7 Mar 2024 18:54:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=78.32.30.218 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709837699; cv=none; b=WQOsGrD4jpQeC81r54n6JLg/jU43oXSPcCdOx/rUiEM4rSJKuhIDwQ3Cg3qo3PppuuERCuYqfC1PSCnfWOykEHN+kZ2941EHPXYPz7x502raQTuR79jDhITk++V5JHv2jl9UkQ2HiLxAOGcRA+tDPECokTTkFz5jJj4gC7XqwUw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709837699; c=relaxed/simple; bh=IPI/16l0HW9qoe0SSsZfA8FdJBqoNMLGPnMIi/2JIMs=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=SHHAvSe97B/MsN4w1XtFds6s49wjI1lBZKfNhsdUyDnqhOUgrZWiegebVplPF4vmlDVu2Opw7AjFUv6Q8pJufhrUFAeCOig4TqdQg6E/g4bUj0Zwo836EqEgIPDWBR/kLnPHCltgeLeLMFsSzvKfj8MDK46wueAz6n+NYMxaLR4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=armlinux.org.uk; spf=none smtp.mailfrom=armlinux.org.uk; dkim=pass (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b=cESIAX3T; arc=none smtp.client-ip=78.32.30.218 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=armlinux.org.uk Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=armlinux.org.uk 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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <49792f54-fa11-4984-8611-84ba640a2b86@paulmck-laptop> Sender: Russell King (Oracle) 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!