Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp1767335ybe; Sat, 7 Sep 2019 02:29:12 -0700 (PDT) X-Google-Smtp-Source: APXvYqx50R5XyzL53tARpXthgkBl0Vf2xSzjloToUjF0Fh7IBVfruiZDARQBj+Xbzg952MPgufJb X-Received: by 2002:a17:90a:bb86:: with SMTP id v6mr1848047pjr.84.1567848552887; Sat, 07 Sep 2019 02:29:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567848552; cv=none; d=google.com; s=arc-20160816; b=lg53AI6I+hYPFj67HybxdduaCelxPSop6giwpgqDp39qMYX/2wYtu1091rNNGW+yWJ kceLfPSoFe6TOeyQbqiHPZSsHE0Ver1VZs4+usA0gTVJwre05vR3gxtmyI4tnC8wHTNZ eLldVJ2WIEZnSwXPjElsYNfPKxO4kWyXLstaCgMx2+xPUYLou10hzouw/dO+21PAT4Eu 0Fx7NpitqVcjE2yrIwpxQ6EdUC+zoj4QkJE3qhEcDPmAotVabUh/lGtjGrRFfyGbd0Dy co7U+KLW29wx5UnUZ4i4iKVBdTAU0cRYNOfdkuJiTR6/7UOq7+4szoDUzZ3stIE+G7Nf 7KQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=/KE1c3CJzeCRGtrdU3es34Atcj0VUKZYhf7xMkZH+3E=; b=vvigkeXdLP1NQ3CdVrH5blo7HYrozNqfDpTWAk7QHB4pjqYwfVQzIK1rBg74aHYsB7 0CkrPPC2cdzSrZH4jpMt3qaeaT/woKur5fMe96n0bweVqmMyaPHOdEOyalj4rUVuP/Vj PRQAn93Ils1aXtMbtFZVVY/doiAw+NWGMLYHqzOGh7oE/LT5F2/1vOJ6dU1gVFXPnEzK jlj8VNbkmxTpnwkJ2h8NHPFO2nwJHhJxp/3DXnij9cyEo1veyjX7K6DnysqMpqE27skp wpx7BAim6wCF82Ou4rOTlb4Nugf4WyMlnkujiKQSxqNN0AraE0YhSipwr1E+LUBEEoQE vfdA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@joelfernandes.org header.s=google header.b=M96DVnPo; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t17si1002613plo.429.2019.09.07.02.28.57; Sat, 07 Sep 2019 02:29:12 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@joelfernandes.org header.s=google header.b=M96DVnPo; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2395084AbfIFQ5y (ORCPT + 99 others); Fri, 6 Sep 2019 12:57:54 -0400 Received: from mail-pl1-f196.google.com ([209.85.214.196]:36136 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726012AbfIFQ5y (ORCPT ); Fri, 6 Sep 2019 12:57:54 -0400 Received: by mail-pl1-f196.google.com with SMTP id f19so3424548plr.3 for ; Fri, 06 Sep 2019 09:57:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=joelfernandes.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=/KE1c3CJzeCRGtrdU3es34Atcj0VUKZYhf7xMkZH+3E=; b=M96DVnPoOSnn9ZAiyntr2dUDzqWyPd37ePDLEXSqvovy5SgInFCKu/LFOExrQKXpdr qvS+o6cPPT6UPBCoqO4O1yTIHWpeolWzBq8841dkTSBW+bIVFxZsEPoG4tYIXtKcL9ts Fi0aGYGo8/lo9tBB7AQ+PXLwq8yVIkvWA08+Y= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=/KE1c3CJzeCRGtrdU3es34Atcj0VUKZYhf7xMkZH+3E=; b=Bl35A/BioL37SIBKhtwcC6Oy9t/vxfBn2XsFVmy9l04NqECHq7U/yAVl3yEWstdg/6 1KmbYiL+9oBzAHt6shT9yxnUjQeePDIHggkT7VdzKJu1NouPFxVNDND0AiT0bsZCugxC ShSG5/PB40D1ZzFI1o299BTLhsZI47DHPHnxWVTPjMjKIlfGV8k3JGeSNwYiO9Ilz+GZ grl4gYia4G1hNuaXsmIdB7xweytYSZ8vM3mtC+3yDVPvWkvJuBFZFoTM+yMO2GFYCJRU TqOQ4FovmBDkojb/ngIk7CbN64Tj+IaBSVqUychnc2Ajhw6iz3VnYfanXWRDZci5P5Uy MF7A== X-Gm-Message-State: APjAAAXyohl+Ox+6Acdor6Aa30yRF1s5eU5p0Uj7yh2aogazbn3zCvkA iSHJBoS1bmnwp6Owm8Ez9TLAHw== X-Received: by 2002:a17:902:7887:: with SMTP id q7mr9917242pll.228.1567789073424; Fri, 06 Sep 2019 09:57:53 -0700 (PDT) Received: from localhost ([2620:15c:6:12:9c46:e0da:efbf:69cc]) by smtp.gmail.com with ESMTPSA id h1sm10170141pfk.124.2019.09.06.09.57.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Sep 2019 09:57:52 -0700 (PDT) Date: Fri, 6 Sep 2019 12:57:51 -0400 From: Joel Fernandes To: "Paul E. McKenney" Cc: linux-kernel@vger.kernel.org, Andy Lutomirski , Bjorn Helgaas , Ingo Molnar , Josh Triplett , Lai Jiangshan , Mathieu Desnoyers , Petr Mladek , "Rafael J. Wysocki" , rcu@vger.kernel.org, Steven Rostedt , Yafang Shao Subject: Re: [PATCH -rcu dev 1/2] Revert b8c17e6664c4 ("rcu: Maintain special bits at bottom of ->dynticks counter") Message-ID: <20190906165751.GA40876@google.com> References: <20190904045910.GC144846@google.com> <20190904101210.GM4125@linux.ibm.com> <20190904135420.GB240514@google.com> <20190904231308.GB4125@linux.ibm.com> <20190905153620.GG26466@google.com> <20190905164329.GT4125@linux.ibm.com> <20190906000137.GA224720@google.com> <20190906150806.GA11355@google.com> <20190906152144.GF4051@linux.ibm.com> <20190906152753.GA18734@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190906152753.GA18734@linux.ibm.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 06, 2019 at 08:27:53AM -0700, Paul E. McKenney wrote: > On Fri, Sep 06, 2019 at 08:21:44AM -0700, Paul E. McKenney wrote: > > On Fri, Sep 06, 2019 at 11:08:06AM -0400, Joel Fernandes wrote: > > > On Thu, Sep 05, 2019 at 08:01:37PM -0400, Joel Fernandes wrote: > > > [snip] > > > > > > > @@ -3004,7 +3007,7 @@ static int rcu_pending(void) > > > > > > > return 0; > > > > > > > > > > > > > > /* Is the RCU core waiting for a quiescent state from this CPU? */ > > > > > > > - if (rdp->core_needs_qs && !rdp->cpu_no_qs.b.norm) > > > > > > > + if (READ_ONCE(rdp->core_needs_qs) && !rdp->cpu_no_qs.b.norm) > > > > > > > return 1; > > > > > > > > > > > > > > /* Does this CPU have callbacks ready to invoke? */ > > > > > > > @@ -3244,7 +3247,6 @@ int rcutree_prepare_cpu(unsigned int cpu) > > > > > > > rdp->gp_seq = rnp->gp_seq; > > > > > > > rdp->gp_seq_needed = rnp->gp_seq; > > > > > > > rdp->cpu_no_qs.b.norm = true; > > > > > > > - rdp->core_needs_qs = false; > > > > > > > > > > > > How about calling the new hint-clearing function here as well? Just for > > > > > > robustness and consistency purposes? > > > > > > > > > > This and the next function are both called during a CPU-hotplug online > > > > > operation, so there is little robustness or consistency to be had by > > > > > doing it twice. > > > > > > > > Ok, sorry I missed you are clearing it below in the next function. That's > > > > fine with me. > > > > > > > > This patch looks good to me and I am Ok with merging of these changes into > > > > the original patch with my authorship as you mentioned. Or if you wanted to > > > > be author, that's fine too :) > > > > > > Paul, does it make sense to clear these urgency hints in rcu_qs() as well? > > > After all, we are clearing atleast one urgency hint there: the > > > rcu_read_unlock_special::need_qs bit. Makes sense. > > We certainly don't want to turn off the scheduling-clock interrupt until > > after the quiescent state has been reported to the RCU core. And it might > > still be useful to have a heavy quiescent state because the grace-period > > kthread can detect that. Just in case the CPU that just called rcu_qs() > > is slow about actually reporting that quiescent state to the RCU core. > > Hmmm... Should ->need_qs ever be cleared from FQS to begin with? I did not see the FQS loop clearing ->need_qs in the rcu_read_unlock_special union after looking for a few minutes. Could you clarify which path this? Or do you mean ->core_needs_qs? If so, I feel the FQS loop should clear it as I think your patch does, since the FQS loop is essentially doing heavy-weight RCU core processing right? Also, where does FQS loop clear rdp.cpu_no_qs? Shouldn't it clear that as well for the dyntick-idle CPUs? thanks, - Joel