Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp170559pxu; Thu, 15 Oct 2020 00:23:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwur04DcAIcZUPL+bo8KJM6gmop8aRV1No1mNpbLoLBEqkBpYJKlIsChN2xiZqmJ8FK5T/z X-Received: by 2002:a50:d483:: with SMTP id s3mr3027932edi.173.1602746607001; Thu, 15 Oct 2020 00:23:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602746606; cv=none; d=google.com; s=arc-20160816; b=PvoglGxeYaGznuIkIEKNfocY0ql4Wp1+dJZgRidqVH4awMEh2rnA69XdYX/+dqEwkg SLU9q68vWBh0GgaIrwTRW5PE6XkmGPowHPTvDNI/RgKkgvc/hXOxYtq4K9S4IT72+Yp5 Muz0wjuOUTT2qXohOjyVLHkP/IDQOZYU9ZpPx76t+svoMinLg+q55D1vjePEURt5ozmD TEAKVRbyQvqkjD0/hTR5o0VpuqngzFKCBmJEKypLkjDV6xXzeknN/Jje7YlYS6THuOlJ nVeA6fMiyMMkH08uUkYhsQoet4Q7BywPYwWRNdXFAKmbe/3jKwJRuyPironq3DFOYHK9 lk/A== 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:reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=HKGH0crv3ZkQ+pdJl+cuExW/Tu2yh5kC8HSoW6xk4Xk=; b=gcVQEBBvsS8T5CnA/fHORKqSn8FaGcngSIFyD9f3oBSv8xjbpqxgzVDtTHTKrYZH85 P27ikDWttVtx9xV17D2JTwsha6VtvM1QgdX0c8GIcXL2mc4v5HGxjNk+VQeV1ITANZBM maPGIEByt5Ltot3wQr/CflDpand7pX+8ONKZKSwU0To+gHYYxlk9+dqofIutGZThDpZQ sHd0XZVnJWjHbxCRxRtYE7SEnsEAQPrBJEOJX26C2tdf8J0T+MMOZmgqqT44ShYC5XT5 4P2xUnvOjOFFTgWWLMicZxWhmqRU1q/CHzkBPDVxKCjOzZR9Av693o1B+SgnokeU8c+c fx9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=T3VFUa3B; 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 l14si1543655ejk.427.2020.10.15.00.23.02; Thu, 15 Oct 2020 00:23:26 -0700 (PDT) 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=T3VFUa3B; 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 S1728098AbgJNWLy (ORCPT + 99 others); Wed, 14 Oct 2020 18:11:54 -0400 Received: from mail.kernel.org ([198.145.29.99]:51320 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726747AbgJNWLy (ORCPT ); Wed, 14 Oct 2020 18:11:54 -0400 Received: from paulmck-ThinkPad-P72.home (50-39-104-11.bvtn.or.frontiernet.net [50.39.104.11]) (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 3FF53221FF; Wed, 14 Oct 2020 22:11:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1602713513; bh=KCd/b7zXWFnEvn+OpcWIQfUR0Qcchqo3tF29cvgpucw=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=T3VFUa3BYH1Waat1be1aCt35tnSG8rKNNh1k0fyyw5IbRevq68+LCiJK2jzTfQUU9 63sqCBUuJpa1fh4mIFADcF0VSOm2iWqLFEjOL/qOJiLf1z4mpNLDjTIRVO0UrK+Kzl Lxxtc69EwOLgqKdOh8tsheg22uZvQNDbNGCHmmQo= Received: by paulmck-ThinkPad-P72.home (Postfix, from userid 1000) id D4F1C35229EB; Wed, 14 Oct 2020 15:11:52 -0700 (PDT) Date: Wed, 14 Oct 2020 15:11:52 -0700 From: "Paul E. McKenney" To: Peter Zijlstra Cc: Boqun Feng , Qian Cai , Steven Rostedt , Ingo Molnar , x86 , linux-kernel@vger.kernel.org, linux-tip-commits@vger.kernel.org, Linux Next Mailing List , Stephen Rothwell Subject: Re: [tip: locking/core] lockdep: Fix lockdep recursion Message-ID: <20201014221152.GS3249@paulmck-ThinkPad-P72> Reply-To: paulmck@kernel.org References: <20201012031110.GA39540@debian-boqun.qqnc3lrjykvubdpftowmye0fmh.lx.internal.cloudapp.net> <20201012212812.GH3249@paulmck-ThinkPad-P72> <20201013103406.GY2628@hirez.programming.kicks-ass.net> <20201013104450.GQ2651@hirez.programming.kicks-ass.net> <20201013112544.GZ2628@hirez.programming.kicks-ass.net> <20201013162650.GN3249@paulmck-ThinkPad-P72> <20201013193025.GA2424@paulmck-ThinkPad-P72> <20201014183405.GA27666@paulmck-ThinkPad-P72> <20201014215319.GF2974@worktop.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201014215319.GF2974@worktop.programming.kicks-ass.net> User-Agent: Mutt/1.9.4 (2018-02-28) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 14, 2020 at 11:53:19PM +0200, Peter Zijlstra wrote: > On Wed, Oct 14, 2020 at 11:34:05AM -0700, Paul E. McKenney wrote: > > commit 7deaa04b02298001426730ed0e6214ac20d1a1c1 > > Author: Paul E. McKenney > > Date: Tue Oct 13 12:39:23 2020 -0700 > > > > rcu: Prevent lockdep-RCU splats on lock acquisition/release > > > > The rcu_cpu_starting() and rcu_report_dead() functions transition the > > current CPU between online and offline state from an RCU perspective. > > Unfortunately, this means that the rcu_cpu_starting() function's lock > > acquisition and the rcu_report_dead() function's lock releases happen > > while the CPU is offline from an RCU perspective, which can result in > > lockdep-RCU splats about using RCU from an offline CPU. In reality, > > aside from the splats, both transitions are safe because a new grace > > period cannot start until these functions release their locks. > > But we call the trace_* crud before we acquire the lock. Are you sure > that's a false-positive? You lost me on this one. I am assuming that you are talking about rcu_cpu_starting(), because that is the one where RCU is not initially watching, that is, the case where tracing before the lock acquisition would be a problem. You cannot be talking about rcu_cpu_starting() itself, because it does not do any tracing before acquiring the lock. But if you are talking about the caller of rcu_cpu_starting(), then that caller should put the rcu_cpu_starting() before the tracing. But that would be the other patch earlier in this thread that was proposing moving the call to rcu_cpu_starting() much earlier in CPU bringup. So what am I missing here? Thanx, Paul