Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp4123425pxb; Mon, 27 Sep 2021 09:51:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxRX5ANWgGLp+3j1xzlTPQhm2qPD5IBY6bKbvanGJwfYucnW23mz+Ct75xdf2Tde9HC2MD1 X-Received: by 2002:a05:6402:5250:: with SMTP id t16mr1083801edd.227.1632761491658; Mon, 27 Sep 2021 09:51:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632761491; cv=none; d=google.com; s=arc-20160816; b=TWWZnXD0/V5HZqKejvgZQ9zS7Yabl2LtBfg43sX2pwz60Y1MvvHtrmgeDwYgjnomcB rAnkdehY4E4YDqNWeYO7zCmq5Gq2IN2bNmVA2yiRC5qz8Q/pMxRxrtAmFI36jDD35xz9 qszfUdR9FRsATUmUDpXFGiZ5j8tH+wqzJcwCT3jp+HW1ERjPAlv4S5KepkZd+nmWz3Xo yTqgiWtl7Cvjydw+g1+mYK6E7oBIom6NKkvfnlCdy1emgRs1FCm25BsqtX3QdKI6tBcf dK4nmmj+WpQOdwC47dpueyKWVT4pE58elA70+rZAjIJIIkKpXGl/LkD6xSCm15E9OKRy 0D4w== 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:message-id:subject:cc:to:from:date :dkim-signature; bh=SoVmLCixo8vvy5jaw3rsSeV3DJrcjyFmlB9X3/o3iPI=; b=IXiLHh+GnVYnTcj8jqhNqijOtOk1kqmnQQF8NEPDcds71bA7oFRCJNrBXSNoSkohxu 0ReikCt470jFUBT28/c9Nx+WCB+DZxLFxT664WxSfnApIET2/I6zgIsAtyg6J21S6UF1 TEOTaHwFLF0h8umt5N8/5btmIPL35RrUWplhO0mQ7bdJlcMRShJq16QoF8lpO0U6iT7o c5MK7bziJAK5LFHdDzyBgRBCXi9SA8B0GpN8Dta48F2TbNR17e5JdvUBvBVyaZhX0Fnm H5GhHXlmDEqwh9iwu2/wcmJZBjM6TyBV9ejbML6YVMYxRUwRcZbawnjSCUKsPA3kODnC zRtQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@morinfr.org header.s=20170427 header.b=h056tP0E; 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 s2si2657067edy.8.2021.09.27.09.51.07; Mon, 27 Sep 2021 09:51:31 -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=fail header.i=@morinfr.org header.s=20170427 header.b=h056tP0E; 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 S235607AbhI0QvZ (ORCPT + 99 others); Mon, 27 Sep 2021 12:51:25 -0400 Received: from smtp4-g21.free.fr ([212.27.42.4]:8470 "EHLO smtp4-g21.free.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235485AbhI0QvY (ORCPT ); Mon, 27 Sep 2021 12:51:24 -0400 Received: from bender.morinfr.org (unknown [82.64.86.27]) by smtp4-g21.free.fr (Postfix) with ESMTPS id 6CB0619F5C4; Mon, 27 Sep 2021 18:49:45 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=morinfr.org ; s=20170427; 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:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=SoVmLCixo8vvy5jaw3rsSeV3DJrcjyFmlB9X3/o3iPI=; b=h056tP0EG+oBqXm39Vi8h404Qi pDSXsSUO9Z54SL1nd2Dd8KohaT2HZNeOsjXIsJobYZNPrWGrYuRj0iinbk1Z+HPHBzVcyuV5tJZio USksvO7wjuxIwRvzxaYBnSEPKKBvMUyAcZuPFchN3uMiHUKHv+GnU7JnfHPJUwAFO3ss=; Received: from guillaum by bender.morinfr.org with local (Exim 4.92) (envelope-from ) id 1mUtp3-0005zs-4T; Mon, 27 Sep 2021 18:49:45 +0200 Date: Mon, 27 Sep 2021 18:49:45 +0200 From: Guillaume Morin To: "Paul E. McKenney" Cc: linux-kernel@vger.kernel.org Subject: Re: call_rcu data race patch Message-ID: <20210927164944.GA20372@bender.morinfr.org> References: <20210917220700.GV4156@paulmck-ThinkPad-P17-Gen-1> <20210918003933.GA25868@bender.morinfr.org> <20210918040035.GX4156@paulmck-ThinkPad-P17-Gen-1> <20210918070836.GA19555@bender.morinfr.org> <20210919163539.GD880162@paulmck-ThinkPad-P17-Gen-1> <20210920160540.GA31426@bender.morinfr.org> <20210922191406.GA31531@bender.morinfr.org> <20210922192448.GB880162@paulmck-ThinkPad-P17-Gen-1> <20210927153842.GA12620@bender.morinfr.org> <20210927161046.GU880162@paulmck-ThinkPad-P17-Gen-1> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210927161046.GU880162@paulmck-ThinkPad-P17-Gen-1> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 27 Sep 9:10, Paul E. McKenney wrote: > Very good! Would you be willing to give me your Tested-by? Of course! Added below after the patch. > > The first patch is already in your rcu tree and my gut feeling is that > > it is the one that fixes the issue but you're the expert here... Though > > I think it should be probably fast tracked and marked for stable? > > > > Are you planning on committing the 2nd patch to your tree? > > This is the second patch, correct? (Too many patches!) Correct. And to be 100% clear, the first one is https://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git/commit/?id=2431774f04d1050292054c763070021bade7b151 > If so, I add your Tested-by and fill out the commit log. It would be > slated for the v5.17 merge window by default, that is, not the upcoming > merge window but the one after that. Please let me know if you need > it sooner. I personally don't need it sooner. But it's been broken for a while (5.4 based on the bugzilla report) and I can't imagine the original reporter and we are the only ones hitting this. So my personal opinion would be to get both patches into Linus's tree and stable branches asap, but obviously this is entirely up to you. I do appreciate the help! > ------------------------------------------------------------------------ > > commit 1a792b59071b697defd4ccdc8b951cce49de9d2f > Author: Paul E. McKenney > Date: Fri Sep 17 15:04:48 2021 -0700 > > EXP rcu: Tighten rcu_advance_cbs_nowake() checks > > This is an experimental shot-in-the-dark debugging patch. > > Signed-off-by: Paul E. McKenney > > diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c > index 6a1e9d3374db..6d692a591f66 100644 > --- a/kernel/rcu/tree.c > +++ b/kernel/rcu/tree.c > @@ -1590,10 +1590,14 @@ static void __maybe_unused rcu_advance_cbs_nowake(struct rcu_node *rnp, > struct rcu_data *rdp) > { > rcu_lockdep_assert_cblist_protected(rdp); > - if (!rcu_seq_state(rcu_seq_current(&rnp->gp_seq)) || > + // Don't do anything unless the current grace period is guaranteed > + // not to end. This means a grace period in progress and at least > + // one holdout CPU. > + if (!rcu_seq_state(rcu_seq_current(&rnp->gp_seq)) || !READ_ONCE(rnp->qsmask) || > !raw_spin_trylock_rcu_node(rnp)) > return; > - WARN_ON_ONCE(rcu_advance_cbs(rnp, rdp)); > + if (rcu_seq_state(rcu_seq_current(&rnp->gp_seq)) && READ_ONCE(rnp->qsmask)) > + WARN_ON_ONCE(rcu_advance_cbs(rnp, rdp)); > raw_spin_unlock_rcu_node(rnp); > } > Tested-By: Guillaume Morin -- Guillaume Morin