Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp583545pxu; Tue, 1 Dec 2020 20:26:31 -0800 (PST) X-Google-Smtp-Source: ABdhPJzI67Fd2gCQkZpKLPr1otRCnk0c6JxstfvZbEgT1MZWgirNSeaZaNOhaIVrnLxtqNG1O+qF X-Received: by 2002:a50:9d04:: with SMTP id v4mr812514ede.363.1606883191179; Tue, 01 Dec 2020 20:26:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606883191; cv=none; d=google.com; s=arc-20160816; b=J6Qt5JIiZPoEz9efpb2WEKHpqn0zsx8Du28GqAxRjzmbP7nOC0YrVBN3pdG3HW4VtO GCun1Hez0LQwHlfvCPqQvd2MKX9nUjSPVJCDa+i2vZZI4DVUB6NSLUyJOlbSEh8SwbhQ a4ZjR4ZIt7jCqDuHz8pedVoFxeomv1mdshT35NO6fmSwp+luMU74XzqQzXsRQB1633BT pBI58xmmF5gejouPBpS97CAfKDRVVcHuQ2Aw4TtfTjcwwfEg2Rpy4VdgZAKok0zbOC/U kTU0Xa72M7vpuQ8nmDbx7FUn1417+a/JKdPSUDxMTpLWknfOFzE3P3h5n9TRZg/OB8je Zvcw== 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 :dkim-signature:date; bh=DKrBZ6uJNqAMaDy59Tn+VZYyDhfa5N+kyHc8xCI6kAA=; b=IrcPqnbpm9XvFzLNjK66Z7JpUXYiWMvuvUjpZ+yZqaSpZTTO/97xGeiHRPUQCuzTrA 2JEDA+Xlw/ada7xXMz+0XW1ar4HpwScB+JNYd/Wu6iuAIf+wYJNyK8ejNjGbWvTYXkuV k5DPce2u+Bw1DtxHSVEjyxnwIIifC67VXovOWKwEV9D7+AwNZ1FBgTHp7tZCbJ4CkhoX xCDxv4sYHepWtVCNp/OYEzTsWAO+LxUDRrCDsyJdLmLLjCEu/rRcgcoJnEXJ9F0vf7Pj HXVYWpMI8ajDpm9oyVweb/oYFajunZtx43Gepxhn11iDITkIExSL06JKYZFjLjDSVW8y omcw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="NitZX/3U"; 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 u9si335852edb.338.2020.12.01.20.26.08; Tue, 01 Dec 2020 20:26:31 -0800 (PST) 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="NitZX/3U"; 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 S2387450AbgLBEWZ (ORCPT + 99 others); Tue, 1 Dec 2020 23:22:25 -0500 Received: from mail.kernel.org ([198.145.29.99]:38572 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726810AbgLBEWY (ORCPT ); Tue, 1 Dec 2020 23:22:24 -0500 Date: Tue, 1 Dec 2020 20:21:43 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1606882904; bh=MRdp6eSGgc4sgDbPueamXIGUlB/+7ZfSfYD9zl4SMu8=; h=From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=NitZX/3ULSa91MxPnLCBE0pRJpBJmmZNFpz7F3mGnWHZatDPb6Umcx/IFgAMsTMH7 zHQkHnbAcURx3EaMfPcuWw4Rlz5eEKTXMT74QkrWmo8TNKJnZsHLv7VJ7W5FsWxdW/ yeN5EtEPzrGhaU6cV6dGXcChXbk0ayWeJDKy6Jac= From: "Paul E. McKenney" To: Joel Fernandes Cc: LKML , Josh Triplett , Lai Jiangshan , Mathieu Desnoyers , rcu , Steven Rostedt Subject: Re: [PATCH v2] rcu/segcblist: Add debug checks for segment lengths Message-ID: <20201202042143.GK1437@paulmck-ThinkPad-P72> Reply-To: paulmck@kernel.org References: <20201118161541.3844924-1-joel@joelfernandes.org> <20201118201335.GR1437@paulmck-ThinkPad-P72> <20201119035222.GA18458@paulmck-ThinkPad-P72> <20201119035613.GA18816@paulmck-ThinkPad-P72> <20201119183252.GA812262@google.com> <20201119192241.GZ1437@paulmck-ThinkPad-P72> <20201119201615.GA1437@paulmck-ThinkPad-P72> <20201119204221.GB812262@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Dec 01, 2020 at 05:26:32PM -0500, Joel Fernandes wrote: > On Thu, Nov 19, 2020 at 3:42 PM Joel Fernandes wrote: > > > > On Thu, Nov 19, 2020 at 12:16:15PM -0800, Paul E. McKenney wrote: > > > On Thu, Nov 19, 2020 at 02:44:35PM -0500, Joel Fernandes wrote: > > > > On Thu, Nov 19, 2020 at 2:22 PM Paul E. McKenney wrote: > > > > > > > > > On Wed, Nov 18, 2020 at 11:15:41AM -0500, Joel Fernandes (Google) wrote: > > > > > > > > > > After rcu_do_batch(), add a check for whether the seglen counts went to > > > > > > > > > > zero if the list was indeed empty. > > > > > > > > > > > > > > > > > > > > Signed-off-by: Joel Fernandes (Google) > > > > > > > > > > > > > > > > > > Queued for testing and further review, thank you! > > > > > > > > > > > > > > > > FYI, the second of the two checks triggered in all four one-hour runs of > > > > > > > > TREE01, all four one-hour runs of TREE04, and one of the four one-hour > > > > > > > > runs of TREE07. This one: > > > > > > > > > > > > > > > > WARN_ON_ONCE(count != 0 && rcu_segcblist_n_segment_cbs(&rdp->cblist) == 0); > > > > > > > > > > > > > > > > That is, there are callbacks in the list, but the sum of the segment > > > > > > > > counts is nevertheless zero. The ->nocb_lock is held. > > > > > > > > > > > > > > > > Thoughts? > > > > > > > > > > > > > > FWIW, TREE01 reproduces it very quickly compared to the other two > > > > > > > scenarios, on all four run, within five minutes. > > > > > > > > > > > > So far for TREE01, I traced it down to an rcu_barrier happening so it could > > > > > > be related to some interaction with rcu_barrier() (Just a guess). > > > > > > > > > > Well, rcu_barrier() and srcu_barrier() are the only users of > > > > > rcu_segcblist_entrain(), if that helps. Your modification to that > > > > > function looks plausible to me, but the system's opinion always overrules > > > > > mine. ;-) > > > > > > > > Right. Does anything the bypass code standout? That happens during > > > > rcu_barrier() as well, and it messes with the lengths. > > > > > > In theory, rcu_barrier_func() flushes the bypass before doing the > > > entrain, and does the rcu_segcblist_entrain() afterwards. > > > > > > Ah, and that is the issue. If ->cblist is empty and ->nocb_bypass > > > is not, then ->cblist length will be nonzero, and none of the > > > segments will be nonzero. > > > > > > So you need something like this for that second WARN, correct? > > > > > > WARN_ON_ONCE(!rcu_segcblist_empty(&rdp->cblist) && > > > rcu_segcblist_n_segment_cbs(&rdp->cblist) == 0); > > Just started to look into it again. If the &rdp->cblist is empty, that > means the bypass list could not have been used (Since per comments on > rcu_nocb_try_bypass() , the bypass list is in use only when the cblist > is non-empty). So the cblist was non empty, then the segment counts > should not sum to 0. So I don't think that explains it. Anyway, I > will try the new version of your warning in case there is something > about bypass lists that I'm missing. Good point. I really did see failures, though. Do they show up for you? Thanx, Paul