Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp4690978pxu; Tue, 13 Oct 2020 05:03:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyasbdGqex85C0gZHCCUsVSEsoS2RLuwZaHmEDIPOu0ZgARSRuK4U6VcCeyLcDVyZPxdr0I X-Received: by 2002:a05:6402:b39:: with SMTP id bo25mr20243883edb.138.1602590625987; Tue, 13 Oct 2020 05:03:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602590625; cv=none; d=google.com; s=arc-20160816; b=MzPLLWYEEe4ZUWTLnlnrzC6hE6Ev8YChUdWC8r2N6NOKY0s8ZyioowbecJxqDvvuKt RVPsdBCUT0fmWGH6T6vgHvShiKQNGsGjQ59grZJr5suYXjZbRbhS79McdZ16P47rAjQg XbQiKxtDXt56l/llPYbc0Pw4b0QAahnhnkfxxHJL/++7QfFix4nV3NODLXRpLzGSdl9g 40rubtFz2Vm+hAQpLPY4NkmPsc/mQ9q3LvbCpaqQ/PMD+AmYBQb5Ch8sTXYCIiE+u4Nl mzfRFr3skn+G6nJTRT/jiOgXVgW2+dkUumuYSadf8XA8JCIo2sIa8VHAwsMFuawpmNah 28Iw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=gHLQIF1wPIEPcvs1yDSFLGHbHVikcssT7QT9S0QYPZ0=; b=bZS11fBnIYzMDJ+0lrElA7eAAkI3K4pbi0QUB/+qWcf58cXzwwUUZaUfd6R7Rchdlq 33AG0lr6BZ/zmaKfEsMAIcmpkN7P5kjhqyp7b1empBUJOXEXaM/Jel2Zj/OErPMX9Gsv sXQjJjcGdOQBe3yfSsyq+MV8QZiwuyx3R8zw6Hw2Ms7QrIW11/Zbg7POKAsGUuHUP87Y jyU0mSRSBWChYdIXRDy10KFEqhPGiaN1BsmcpCVCHUL5anHX7BZ8YhobXl3zMVAhN2VS F9fNB6zfMHmp4Xdn04wo1C/4pZymOQL641sbdn0fC7Hq1sKmXwk6NW9iYS0nwzgR/Rv1 ONVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=merlin.20170209 header.b=J9TsIgkn; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e14si14168300ejx.177.2020.10.13.05.03.23; Tue, 13 Oct 2020 05:03:45 -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=@infradead.org header.s=merlin.20170209 header.b=J9TsIgkn; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387573AbgJMKpD (ORCPT + 99 others); Tue, 13 Oct 2020 06:45:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57846 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387472AbgJMKpC (ORCPT ); Tue, 13 Oct 2020 06:45:02 -0400 Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3BE7BC0613D0; Tue, 13 Oct 2020 03:45:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=gHLQIF1wPIEPcvs1yDSFLGHbHVikcssT7QT9S0QYPZ0=; b=J9TsIgknk14qtvOmh0mihWXo8U fNH1jLPZFLXBS+46hVfgA+oRTeOWQNkztS6FCuM/vAxeTEZf7pzxNqpwgmk2vuyWM0/ikEjKd0UMd 1l9j49qBYknzxMElg15hmabowJi0fGHtF6ZHzDhAkt7wdlSvpkgyU9TaqdWLfbkXSsquh2ltBfiLP dEkJHBoTiQjD7aAl4PzzYhcQMjN0vlZT2ZRalQiBYr93r0OkU3g5ki6NTVcwqBn54rgwAd9zlleMI OQJAcBJOwC71dk5CShuxatVtHaqy5TPMJc2SdGFhQ2224qSUhATuC7AgcuB1zucWO5e8ODG7Ri3u7 SjVhq9Lg==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1kSHnZ-0006IX-8b; Tue, 13 Oct 2020 10:44:53 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 7E459304E03; Tue, 13 Oct 2020 12:44:51 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id EE4F020AEA646; Tue, 13 Oct 2020 12:44:50 +0200 (CEST) Date: Tue, 13 Oct 2020 12:44:50 +0200 From: Peter Zijlstra To: "Paul E. McKenney" 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: <20201013104450.GQ2651@hirez.programming.kicks-ass.net> References: <160223032121.7002.1269740091547117869.tip-bot2@tip-bot2> <20201012031110.GA39540@debian-boqun.qqnc3lrjykvubdpftowmye0fmh.lx.internal.cloudapp.net> <20201012212812.GH3249@paulmck-ThinkPad-P72> <20201013103406.GY2628@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201013103406.GY2628@hirez.programming.kicks-ass.net> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 13, 2020 at 12:34:06PM +0200, Peter Zijlstra wrote: > On Mon, Oct 12, 2020 at 02:28:12PM -0700, Paul E. McKenney wrote: > > It is certainly an accident waiting to happen. Would something like > > the following make sense? > > Sadly no. > > > ------------------------------------------------------------------------ > > > > diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c > > index bfd38f2..52a63bc 100644 > > --- a/kernel/rcu/tree.c > > +++ b/kernel/rcu/tree.c > > @@ -4067,6 +4067,7 @@ void rcu_cpu_starting(unsigned int cpu) > > > > rnp = rdp->mynode; > > mask = rdp->grpmask; > > + lockdep_off(); > > raw_spin_lock_irqsave_rcu_node(rnp, flags); > > WRITE_ONCE(rnp->qsmaskinitnext, rnp->qsmaskinitnext | mask); > > newcpu = !(rnp->expmaskinitnext & mask); > > @@ -4086,6 +4087,7 @@ void rcu_cpu_starting(unsigned int cpu) > > } else { > > raw_spin_unlock_irqrestore_rcu_node(rnp, flags); > > } > > + lockdep_on(); > > smp_mb(); /* Ensure RCU read-side usage follows above initialization. */ > > } > > This will just shut it up, but will not fix the actual problem of that > spin-lock ending up in trace_lock_acquire() which relies on RCU which > isn't looking. > > What we need here is to supress tracing not lockdep. Let me consider. We appear to have a similar problem with rcu_report_dead(), it's raw_spin_unlock()s can end up in trace_lock_release() while we just killed RCU.