Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp834737pxb; Thu, 5 Nov 2020 14:24:55 -0800 (PST) X-Google-Smtp-Source: ABdhPJxRgAJZR9jsyk4JjCfvcW2lMRwwWKt9onvd7lp+1L9zn67LxjRikKoPKULykTIHmFL02pxN X-Received: by 2002:a17:906:6d52:: with SMTP id a18mr4452322ejt.224.1604615094986; Thu, 05 Nov 2020 14:24:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604615094; cv=none; d=google.com; s=arc-20160816; b=EeigOjlAMangadAwLs3pIs26GqJ+m8qT5pmdt/N3V+emWz7s4eqTijikfhmU1JzuIP CpzaQ9Y6hIvYiirX8TdSEEliRCkQuAn3s5JJbz7QZr901oOGHtQ6lxuqwZTod+HtAb0q tupRZ5pnAdduBWeis9TWXs21x0nZAKi1WMbL+SzNPa4Me3k0UpCHvElgj4W3bxYE/slH dXH0jsqAnf04d98iznN3AAKvmSAZ6h/PdbHSYgY7KFvu5L8VcN7dKoy6PqVrOvwPWld9 5ULEawRwHi2CjlfNzZMshsjCKy+3z8jQ2z+Rkayquq9EdsMtNoCRNRva1QcWTdDPl/2a zCXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=oubdY5dL8IWHVL2bw0xQO4/LJhas/A/+zOy2Y0Ppnz4=; b=DO8Wu7MigEwj6GPm6Dx4qU8c3ZdIqQ5vm1I5oBMs4osBBclVo0u+1C+Wr/f3dWLCFC yDtsWzelXVOXQbQmTHFA2PL3vBUrBSuiLHfp0cLSAfD+6n7DKbp7BtUW+UTdXl2U9kwj ZWT/4P7IYQOKn5P0VcDHeeOjrkAj4IXy/UW1mus4ZaLbETQWdV8z+GTUK4hBrTfE7/FP 728xay7bm6zn6boEZ9206D8R774V4scQpu9HC88csZo2UTLAajLKSMKFcWBoWzU/O9uH 0l3mI2BramXT1QjVky52vLi+7J1StA2QVRG0PguptSfxqTFAeQh7O4mExvTIqh7m8uR9 NmeA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=MFoRiM8f; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bi24si2042701edb.452.2020.11.05.14.24.32; Thu, 05 Nov 2020 14:24:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=MFoRiM8f; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732518AbgKEWWr (ORCPT + 99 others); Thu, 5 Nov 2020 17:22:47 -0500 Received: from mail.kernel.org ([198.145.29.99]:40952 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732465AbgKEWWr (ORCPT ); Thu, 5 Nov 2020 17:22:47 -0500 Received: from willie-the-truck (236.31.169.217.in-addr.arpa [217.169.31.236]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id AA7F5206D4; Thu, 5 Nov 2020 22:22:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604614967; bh=W6P9EGgk/Hz7hh/sGeR/yi9cL4CFrlMuo539zWXNLAk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=MFoRiM8fecMwx2zSlddYSlFtmVnCn8plHcajnHLgL3IxujVlIFjylh9Q43uRZtL1E 4fvGJge39AuH0uPW3d3zCEnvp7D+bRNAt6ELh+9hSUiPfNJDpeHJCziSc7l9XKQSKC vsJsqH1nFcrlIyynG9G0PrwYcsx0Z+QdNYVaSWxw= Date: Thu, 5 Nov 2020 22:22:42 +0000 From: Will Deacon To: "Paul E. McKenney" , Qian Cai Cc: catalin.marinas@arm.com, kernel-team@android.com, Peter Zijlstra , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH] arm64/smp: Move rcu_cpu_starting() earlier Message-ID: <20201105222242.GA8842@willie-the-truck> References: <20201028182614.13655-1-cai@redhat.com> <160404559895.1777248.8248643695413627642.b4-ty@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <160404559895.1777248.8248643695413627642.b4-ty@kernel.org> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Oct 30, 2020 at 04:33:25PM +0000, Will Deacon wrote: > On Wed, 28 Oct 2020 14:26:14 -0400, Qian Cai wrote: > > The call to rcu_cpu_starting() in secondary_start_kernel() is not early > > enough in the CPU-hotplug onlining process, which results in lockdep > > splats as follows: > > > > WARNING: suspicious RCU usage > > ----------------------------- > > kernel/locking/lockdep.c:3497 RCU-list traversed in non-reader section!! > > > > [...] > > Applied to arm64 (for-next/fixes), thanks! > > [1/1] arm64/smp: Move rcu_cpu_starting() earlier > https://git.kernel.org/arm64/c/ce3d31ad3cac Hmm, this patch has caused a regression in the case that we fail to online a CPU because it has incompatible CPU features and so we park it in cpu_die_early(). We now get an endless spew of RCU stalls because the core will never come online, but is being tracked by RCU. So I'm tempted to revert this and live with the lockdep warning while we figure out a proper fix. What's the correct say to undo rcu_cpu_starting(), given that we cannot invoke the full hotplug machinery here? Is it correct to call rcutree_dying_cpu() on the bad CPU and then rcutree_dead_cpu() from the CPU doing cpu_up(), or should we do something else? Will