Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp2421425pxu; Fri, 9 Oct 2020 17:23:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyDJN6jmW3qiMpPI0eEy28dvQtWMyglLu4gJcrnSZGOWAkLrVyM1zSgOUNulefMlAPof1uC X-Received: by 2002:a17:906:8157:: with SMTP id z23mr16263483ejw.274.1602289398203; Fri, 09 Oct 2020 17:23:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602289398; cv=none; d=google.com; s=arc-20160816; b=tHG3hiyPUpJbmhIEtuStiNC/gbQEbYFHizWZYajV8KB2zbgjZdRpz40AOwTpopjIPo 5iLbcySmzWQNaBTLoie+iRvKP1nj+22nyJQjXnNO83UwhAId3eUFYVUKVSgVfUix7U/8 Zuw0beUpJ0oUy4PZM0oOKPAj9ehrBujdtzV211WE6iTEv0rOr23cSqMkHR/WhcKZC4I+ ibEuKRLi9y0RQTm+bBC/cEDd1ioY92oTVO3pUw3lMNJvblJI2Pvhh9BN2ZDe5tlPkyU5 Htu490lLim7/nVQuDPT5oj04oV4XDe1d+AeGx9ieU1uflrB8PZupa2lgOYE13+9DYRtk 7nWg== 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=t8md9bVtDewUlGmxviW9wZbQ9D3pca12dxCQjFxO280=; b=W6YeOtRd89G03asBVlZyrDc05pIBoGfIDL+qPGxf6a4FEDgcQK7aHzzpES6n+MKAzW M75WTdu6YpLoKBsg6XkMAyC8HdZ2GM/nFeYQVc8B3uKSpRk8iDdJcC8V9LIM+cVlVLSt Rc1AV6bdK4zwjYqAGxhZe8U6nKu5x86Hpy8/JPiu3tPzvJasEZdhL/SSVNEvMBcAt1kF hVeksPH3DKMnbzuOODNw0ffs3n2NFUbZCNN1zjGlxAEqjUy/X+zcnqZXatJDbyV84QLA uoZ+1MEQRkSvOmQpAfcN+Zj2/fnrBwY86omO9KcS0fNLPvB4eruOq8QtYoZEbr40I7tw XVQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ZwRpWKOD; 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 n15si9135362edy.300.2020.10.09.17.22.55; Fri, 09 Oct 2020 17:23:18 -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=ZwRpWKOD; 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 S2388045AbgJISVv (ORCPT + 99 others); Fri, 9 Oct 2020 14:21:51 -0400 Received: from mail.kernel.org ([198.145.29.99]:60776 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390337AbgJISVv (ORCPT ); Fri, 9 Oct 2020 14:21:51 -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 4E9B522284; Fri, 9 Oct 2020 18:21:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1602267710; bh=lZeKmEBYOFSPyXXAEhd82JvzWUbzSvGCdC+F4wT6yGk=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=ZwRpWKODPUQmv/XpL7UIxEsk9FGD5WINOwMfvs7Ws3h1vhZFZyNVXqJjJehioJgJl pvl5a4yETlhqP9KJxgRsltYcR1QaZ+yL5xpmzpqzBG3TWXZUvw4232yYdon8nPgjuc t7A/AN8shitzAWTjPRoPE5LVvCNr1EVuLNKbnu+I= Received: by paulmck-ThinkPad-P72.home (Postfix, from userid 1000) id 0E9CC35227D5; Fri, 9 Oct 2020 11:21:50 -0700 (PDT) Date: Fri, 9 Oct 2020 11:21:50 -0700 From: "Paul E. McKenney" To: Qian Cai Cc: Peter Zijlstra , Steven Rostedt , Ingo Molnar , x86 , linux-kernel@vger.kernel.org, linux-tip-commits@vger.kernel.org, Linux Next Mailing List , Stephen Rothwell , Boqun Feng Subject: Re: [tip: locking/core] lockdep: Fix lockdep recursion Message-ID: <20201009182150.GK29330@paulmck-ThinkPad-P72> Reply-To: paulmck@kernel.org References: <160223032121.7002.1269740091547117869.tip-bot2@tip-bot2> <20201009135837.GD29330@paulmck-ThinkPad-P72> <20201009162352.GR2611@hirez.programming.kicks-ass.net> <942e0ffb37a4580982206d72404c521d72d38314.camel@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <942e0ffb37a4580982206d72404c521d72d38314.camel@redhat.com> User-Agent: Mutt/1.9.4 (2018-02-28) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Oct 09, 2020 at 01:54:34PM -0400, Qian Cai wrote: > On Fri, 2020-10-09 at 13:36 -0400, Qian Cai wrote: > > Back to x86, we have: > > > > start_secondary() > > smp_callin() > > apic_ap_setup() > > setup_local_APIC() > > printk() in certain conditions. > > > > which is before smp_store_cpu_info(). > > > > Can't we add a rcu_cpu_starting() at the very top for each start_secondary(), > > secondary_start_kernel(), smp_start_secondary() etc, so we don't worry about > > any printk() later? > > This is rather irony. rcu_cpu_starting() is taking a lock and then reports > itself. > > [ 8.826732][ T0] __lock_acquire.cold.76+0x2ad/0x3e0 > [ 8.826732][ T0] lock_acquire+0x1c8/0x820 > [ 8.826732][ T0] _raw_spin_lock_irqsave+0x30/0x50 > [ 8.826732][ T0] rcu_cpu_starting+0xd0/0x2c0 > [ 8.826732][ T0] start_secondary+0x10/0x2a0 > [ 8.826732][ T0] secondary_startup_64_no_verify+0xb8/0xbb Fun!!! There should be some way around this. I cannot safely record the offline-to-online transition without acquiring a lock. I suppose I could trick lockdep into thinking that it was a recursive lockdep report. Any other approaches? Thanx, Paul