Received: by 2002:ab2:3319:0:b0:1ef:7a0f:c32d with SMTP id i25csp92200lqc; Thu, 7 Mar 2024 11:10:48 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXdgSVQwz6VTIJZCqQP2Vt3vyUHIQ+9hvYNipYVECxCL771F0TLngz5qoXWbCacR4lBT+h3rVkbev4IeurZsesLuuLn/oWFPNbleycJAg== X-Google-Smtp-Source: AGHT+IG90YHpaMPiD9wBrgivPUKja7hs/B+nK9vzE+ZDm65Jv8PkNNFfExM67vPQINdm0hGq6hha X-Received: by 2002:a17:906:fb81:b0:a45:9e6e:fba1 with SMTP id lr1-20020a170906fb8100b00a459e6efba1mr2209085ejb.15.1709838648363; Thu, 07 Mar 2024 11:10:48 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709838648; cv=pass; d=google.com; s=arc-20160816; b=pWKv5a/55UZgjE9bpxJBEUv6CGU56G+G6lWvOo9qd9ci0qIcJ/h55y1ZaSXcYIQ4Sy mpEbWewWtiMIMwxfEj3MgjFpMvwO4T8JY+ORHEcuIqbcNTuOW6lTBq09FKdYblz6c2bt l4TpWi7VrEEWZST7ooxf0z0AGmGRmkFM7f/0FATFiHmzw2gqg9s8CcO9o+dFxlRMaY38 DpQlaph6fkgwQF4rYPi+Jsn8h6J8+s2GhyBoOqEDJPkQ/YkaKztLigcyg3Eq6G+BDzxy HnLZTzh1zab2JnKQC0Vi2suPNfqTSLzhc8sKHybQW7Z6WZVyVUh5Oodb8JBupXmiXfn0 HDWg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=BbLJ+YJF6YdBW/WEZH45N2lyoUxjX5+hBFl2+7uD4fA=; fh=J7Ctcks7DUILaY4Q0aGiDqFZ9GpS17NtF4o24ja9sf8=; b=D7vfpdldJV69VuPT0Hh3xFxU1ubLp1YDJRKSbudQKtuNjqP7DUHjz6lNwt2c8k9Qs/ zBOzURGkHEXKSaCnKK9w3GPWvlR8w4xfGsOps9Sd446eO+I3SWljIm1fH0CQpQWv70Pp Un29vbsxVWHHWk54QlhJhjQCpKyBWR3X5w/XzgHRUTV2EZPjerXDqNFr/4ScxjNs5DrU EBDEzBY5pteTJsn2yBWrjtGnam2FKj9PBOG7FnZPigEGAfbXeV9imE5sUHYlBUNyocuf 3woXLwxp70ovDDRsIuDRcAyC/GJscG9qOcTAHDjbZsg57YUFTNLB6QDIHG1b2ONLmW5E czfw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=HJdJRGZy; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-96071-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-96071-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id i22-20020a1709064ed600b00a45b622be5asi1885303ejv.717.2024.03.07.11.10.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Mar 2024 11:10:48 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-96071-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=HJdJRGZy; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-96071-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-96071-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 am.mirrors.kernel.org (Postfix) with ESMTPS id AF0381F223D6 for ; Thu, 7 Mar 2024 19:10:47 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 04089137C45; Thu, 7 Mar 2024 19:08:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="HJdJRGZy" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 2548D13664E; Thu, 7 Mar 2024 19:08:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709838484; cv=none; b=j5jKBpmNXUySKeIFtA6KVJSSa6e6uBvqFj8Gz0GMW52+xElwUvKOgp+CUVe/OUisiWN8Vzl54Z7IK2PbDKmJe5KOHOOWLaEUsXxTj+f2zNdr2aK0EIrZpMv43q46a97rIKoS5DIsWsqzVteonqrpElJmp5lqvbrPkKIZOZ+R938= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709838484; c=relaxed/simple; bh=yEOL18TbJDjwRAvn0qMrkNVx3ik8b1Q3Htm6MzV8i3g=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=NaJvuN2L8FuKxuBWqvVjVuFyhaNl/2ybpkTzPjHh1Ud9I+ryXLpoVZAF7BqKrjK2aCUVWTozBeu3Os692X/+6EACrUlXNQJx5zMMk0BAjuHxoWYa+qbXSa8H/BhFQDRg5OG3peA6IyPatgxYviv+SG/1Owv1jacqTNzKWARSzi8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=HJdJRGZy; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8B3B2C433F1; Thu, 7 Mar 2024 19:08:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1709838483; bh=yEOL18TbJDjwRAvn0qMrkNVx3ik8b1Q3Htm6MzV8i3g=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=HJdJRGZyCRDcTmI2TLf3a9RuWEcViwOMyY5mYI8cUh4obB220U/FeLuF6A99W6Jvl IKETLpXHZRcZyURy8yqsf6OmsvNBgr9CIh1JLB/VeNgPsQEepgKeKp1k3KasNIFMTE gc2nFFC0XmEkQtCT/A0OvPJy6/IexoQ4MTIK77sd644Cr1sWSVuUul7BTX1aYYIqYj h39f+hu2ko9FYrvSgw9xSofJhBdAVTsn6Ua/Fo18pFWIvke5sk6aRFjpjEwiw4MQE1 YmThMAWMyONtTKEEwJknndwrxu+9UAIh1vuf/BC8wpJhqc7ZGWB1NshLN2yC3qePgF v0wRqUtJRk/1A== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id 21FD9CE0716; Thu, 7 Mar 2024 11:08:03 -0800 (PST) Date: Thu, 7 Mar 2024 11:08:03 -0800 From: "Paul E. McKenney" To: "Russell King (Oracle)" 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: <293fbcc5-0c2d-4937-9026-a05236e1fc40@paulmck-laptop> Reply-To: paulmck@kernel.org 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: On Thu, Mar 07, 2024 at 06:54:38PM +0000, Russell King (Oracle) wrote: > 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. Telepathy? ;-) > 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. Thank you for the info! Thanx, Paul