Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp511443pxu; Thu, 15 Oct 2020 09:18:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyJTYZ7ynFM56L00uHiPfwXYPNFqhZ3uWo9+G3I4P3NHQFd4py5aJM/rCIpgrh8tZ6ay5/p X-Received: by 2002:a05:6402:1684:: with SMTP id a4mr5090097edv.79.1602778714111; Thu, 15 Oct 2020 09:18:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602778714; cv=none; d=google.com; s=arc-20160816; b=sY5k5bUb0yoeW48POA4Mv/a+jrIyhVgG0fBmQP7tb/yUbDhGijlVocnL0oTDlgD6VF BDwyEoo9yw7FHUihZ8haGjkX2G5HynlPyyxeKb4Cjja+5To1DbBRZH3+bVoas/omkkmg YA2zWLPXANgHKNQvWk1YWKFoD3wzgNlDdy0DwYE8xxBaucnDFWU0vBeR5OG0qkd4vLE2 RiDz1mcucZgcy/KAibU0/8NHrqIR6ZjU7vpu94Gh58pQhEVRn5K7LTYDEch+Sed0O0L3 TUreDMqJog3o8hdrkCsOQk4C1KsitDclD8MJohqChvGy2BNAM10wLGYd5XQ+v4lk/xpY NCUg== 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=SqRVsgDJllR8tbLtY0TgAV+gu5458x9CFjSZTHWihB8=; b=vMFWymUqpMIdrH2Y4+mXRWCWPxaNH+javGUJQJHWC7fe4UxI1dWfM73PminQNhOMPZ 5X+9PCqgWPzAprzgZb19V9mmeoIQ5C+TfgHWizSmGWtxWbf4XPQzUDNmZjv+hLgztKlB JBvosxJa5lWQBjypSxlu+dG4Ttoa4RQqm9jkyyOFXjAjUmiJT0wGEpSBAomDyK9IysQc OByM3sQe1Y5+CEIX8JIoHYpWBTtPK+YIQIXimLdPSovp0KsrRe1BUuZjqxFNr0K8tmhk 4prrIgk5NZ0Rafn0+0wkmdzluNOaa2fVxFdO/fVvyc2YMMkSNLX5AATLdWBbL3xPa1N7 DDcw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=j7F492h2; 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 i20si2464065ejh.16.2020.10.15.09.18.05; Thu, 15 Oct 2020 09:18:34 -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=j7F492h2; 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 S2389658AbgJOQPU (ORCPT + 99 others); Thu, 15 Oct 2020 12:15:20 -0400 Received: from mail.kernel.org ([198.145.29.99]:49702 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389147AbgJOQPU (ORCPT ); Thu, 15 Oct 2020 12:15:20 -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 A687722210; Thu, 15 Oct 2020 16:15:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1602778519; bh=w2Lc3Nsk0vgnR8RykF7cI6BlE8Oh0QWGGrfC+w8owIk=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=j7F492h2m7HdUmWC0t2V/7YkoNLeqZLT6vGXIWSgoGmntyNMmMiY2eRt7Sc4jRN9f f8Gf152hh/jg25UfNXa480ywL3Vhvhgt09lDQTITvrNyOyYL5vHimTcOuc9c4vrJ2Q 6EeWncxOMlrLFUgBxOrhwvx/maIU25tC/nxn5wLU= Received: by paulmck-ThinkPad-P72.home (Postfix, from userid 1000) id 45B2E352078F; Thu, 15 Oct 2020 09:15:19 -0700 (PDT) Date: Thu, 15 Oct 2020 09:15:19 -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: <20201015161519.GW3249@paulmck-ThinkPad-P72> Reply-To: paulmck@kernel.org References: <20201013162650.GN3249@paulmck-ThinkPad-P72> <20201013193025.GA2424@paulmck-ThinkPad-P72> <20201014183405.GA27666@paulmck-ThinkPad-P72> <20201014215319.GF2974@worktop.programming.kicks-ass.net> <20201014221152.GS3249@paulmck-ThinkPad-P72> <20201014223954.GH2594@hirez.programming.kicks-ass.net> <20201014235553.GU3249@paulmck-ThinkPad-P72> <20201015034128.GA10260@paulmck-ThinkPad-P72> <20201015094926.GY2611@hirez.programming.kicks-ass.net> <20201015095033.GS2651@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201015095033.GS2651@hirez.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 Thu, Oct 15, 2020 at 11:50:33AM +0200, Peter Zijlstra wrote: > On Thu, Oct 15, 2020 at 11:49:26AM +0200, Peter Zijlstra wrote: > > --- a/kernel/rcu/tree.c > > +++ b/kernel/rcu/tree.c > > @@ -1143,13 +1143,15 @@ bool rcu_lockdep_current_cpu_online(void > > struct rcu_data *rdp; > > struct rcu_node *rnp; > > bool ret = false; > > + unsigned long seq; > > > > if (in_nmi() || !rcu_scheduler_fully_active) > > return true; > > preempt_disable_notrace(); > > rdp = this_cpu_ptr(&rcu_data); > > rnp = rdp->mynode; > > - if (rdp->grpmask & rcu_rnp_online_cpus(rnp)) > > + seq = READ_ONCE(rnp->ofl_seq) & ~0x1; > > + if (rdp->grpmask & rcu_rnp_online_cpus(rnp) || seq != READ_ONCE(rnp->ofl_seq)) > > ret = true; > > preempt_enable_notrace(); > > return ret; > > Also, here, are the two loads important? Wouldn't: > > || READ_ONCE(rnp->ofl_seq) & 0x1 > > be sufficient? Indeed it would! Good catch, thank you!!! Thanx, Paul