Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp2400643pxu; Fri, 9 Oct 2020 16:34:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwzjIhvYeB270uIfhR0qvedK0sOfzmU0MuVgrDnchOK6aevjzI/qfYJT97xsVY3RgEtcjf4 X-Received: by 2002:a50:9b5b:: with SMTP id a27mr1715602edj.374.1602286489758; Fri, 09 Oct 2020 16:34:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602286489; cv=none; d=google.com; s=arc-20160816; b=Bn5LrvW4N7o2LfwNwvYZLXYbsMTGSdzlYam0u8iTfTc6HwFX9f3G6yHqjwwn+0bwdY adVF/JkUBWPaoWdXHYe963HLiYiBGMrm0039ppdWZNjOryoyptaxDQCL1QMfsQh36yhc 1lecDAe8lkgxh/2G16IDAWO8yhITh7i7jc/QEdcY86AbLl1wC2mVQJ9L8IkMF4+MQWRH ZSe9gMlof76El+Ai9XPUBm83vtIkYnvUDtR+tCHo1EyNdMTEYFoAN2xpRyqOcW246TPm tFtutkNZknHcEXBkPWjD2muFGZC6I6b64JKdY3HaomqZU/ppkdb5bXObYda1kBJjjHcl Y+vg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id :dkim-signature; bh=j5lS/XyFlFyWGw8WTiJQaNa1adNpHA0kZZEkG97cs5w=; b=CDkEM9pPb1FRPa7LK/4IA1CSgwrtiH8KxSquW0zmLSHCO2H15n+960YicPFjDbZe55 cycb2vyylD788d1qr0Wmu0VxW/V/pw7Gh1NRPSX8VqeKKHkiTjf75F3iHyxDccrVIoiz GOGgAwHYrm83Bo06r3NVnSRGLJ7PSrdaoAfEmWWefVo0y9ZE/BHQUV9NrXAayTTCXgSS qSqEAQcrKYMu0nSYZdYCpAnmff+GPLC2fIJZaLqAGuQSfl3TNhatvJ+4ZzmpzgQDzz5D azVTmay2r8CCzbDJqEtq7W/QYEZtvSwZs21eT4ztF6mltsh6nhZVWUd4I6FLdTluRAKb swYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=VKXH+QZ3; 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dg18si7108215edb.214.2020.10.09.16.34.26; Fri, 09 Oct 2020 16:34:49 -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=@redhat.com header.s=mimecast20190719 header.b=VKXH+QZ3; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387420AbgJIRyl (ORCPT + 99 others); Fri, 9 Oct 2020 13:54:41 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:60739 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731500AbgJIRyl (ORCPT ); Fri, 9 Oct 2020 13:54:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1602266080; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=j5lS/XyFlFyWGw8WTiJQaNa1adNpHA0kZZEkG97cs5w=; b=VKXH+QZ39cetvnsz2PX3zqS04LQ0tFDxiCXSD60GC9Unp06PFID2KAVuiVS5ThPlsB8k5L SviQ+lhQ4B8PPhpBPVHWJM+elLULqJo4NJSMKqxirqo+2ifWBuLC6B710RVZxi71yp5+Yc 2+nXipv/rnyHXoms+4/HfkWy495sAJE= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-108-GNB71R8cMd2BnObDobOm0g-1; Fri, 09 Oct 2020 13:54:38 -0400 X-MC-Unique: GNB71R8cMd2BnObDobOm0g-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id CD283108E1A0; Fri, 9 Oct 2020 17:54:36 +0000 (UTC) Received: from ovpn-66-175.rdu2.redhat.com (unknown [10.10.67.175]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2DA7119D7C; Fri, 9 Oct 2020 17:54:35 +0000 (UTC) Message-ID: <942e0ffb37a4580982206d72404c521d72d38314.camel@redhat.com> Subject: Re: [tip: locking/core] lockdep: Fix lockdep recursion From: Qian Cai To: Peter Zijlstra , "Paul E. McKenney" Cc: Steven Rostedt , Ingo Molnar , x86 , linux-kernel@vger.kernel.org, linux-tip-commits@vger.kernel.org, Linux Next Mailing List , Stephen Rothwell , Boqun Feng Date: Fri, 09 Oct 2020 13:54:34 -0400 In-Reply-To: References: <160223032121.7002.1269740091547117869.tip-bot2@tip-bot2> <20201009135837.GD29330@paulmck-ThinkPad-P72> <20201009162352.GR2611@hirez.programming.kicks-ass.net> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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