Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp2777288ybl; Mon, 19 Aug 2019 07:23:41 -0700 (PDT) X-Google-Smtp-Source: APXvYqznIEZR4BVE/Fi2qt7u7xogkPx2aX0Y6NPv8Ly4hA9OqPMNIbrmt/wbnq+BWZyvG3TlIlsz X-Received: by 2002:a17:902:7786:: with SMTP id o6mr12348839pll.11.1566224621471; Mon, 19 Aug 2019 07:23:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566224621; cv=none; d=google.com; s=arc-20160816; b=JP58nYIHKnL5XbCTuMOyZv18atkOXLWS+qSG2saiXKyXACIn9PW5061XmpHpBA1Q8n E7vrIX0Iq5l3xnnYrm/sFI0GIfQ0DwC6S/hqrkeNrYQufJiY284xE4Ex4j1k0P/vN3DY 6fnOaMj7/eToeBPbEGFlPzhMx41nq6ToUqipVeasufsvIEeqL7/Tr7M1Or/DhV528spa G+r1wVSLt8zRkJUFt0ltLXKeNs2xgcpiVDXS6rKOhsE/ad2Vu7avFIXoql2wKguXLbic evS3sq7ua6rGDT26gZS3EW8FMsTHjv9vYhW6d9lIfpyeGbrBKmeJ71yfNUJ02pTDkBXR 0ReQ== 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=PfWjNfLJ6k4OXcw3r2VepdtUPQsgg6X90jwMO+m8X1E=; b=xGsUK9OoGPAgcaOGFPyA5TNcXS9cBR43ADMvoLDbGLRBKQKaqZNG7qtwByJEj3gvwH Tr4Ie5XYKSm/KnFxZbXVdJ06mQAwQZd4GeaEONdZsmUBM/uGcJ8eR5gGx2+BbI2bAB1E jheHroa6d9nd2l67epc4mqbkSR9SsnZbBDVwQEO+zP4r+FQWGQHHvr/sCZscwLvBx80D gu+12gtEBQs+0Hu27SciTfsclB9WsB02KyO7VTSmCs5DzM/6lb6ZKobtmWT89LFVUsfZ ybbxIy8IsCOEyRHwbBBlJMsY/JmsXh4yVNQeh8Ihqn1hda56AAKjmTjyZdPzvQeBTOcL 1NzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@joelfernandes.org header.s=google header.b=vvQzmIgN; 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 x12si8113701pln.219.2019.08.19.07.23.26; Mon, 19 Aug 2019 07:23:41 -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=vvQzmIgN; 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 S1726842AbfHSOW0 (ORCPT + 99 others); Mon, 19 Aug 2019 10:22:26 -0400 Received: from mail-pg1-f193.google.com ([209.85.215.193]:38706 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726028AbfHSOW0 (ORCPT ); Mon, 19 Aug 2019 10:22:26 -0400 Received: by mail-pg1-f193.google.com with SMTP id e11so1319035pga.5 for ; Mon, 19 Aug 2019 07:22:26 -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=PfWjNfLJ6k4OXcw3r2VepdtUPQsgg6X90jwMO+m8X1E=; b=vvQzmIgNuuyOTVF2FwsTbk73dFiZkUYlcaEPM5KtN9TPYn9mCFQQU35pXRQ+Hz8xcK hKoKtoMhDWeKCtTi2u4p9qv8hCwSGuaEv14CcVo2pBU5hK5b4EP8Oma93P3GntTJdrbH oZwbrmSbKH02e5fAOqVg0s7QqifoHgXlJE2+A= 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=PfWjNfLJ6k4OXcw3r2VepdtUPQsgg6X90jwMO+m8X1E=; b=rMe0w7VmFZM+ZBFv6pGhHe5/K2SjC8G8wXhnU+fN4VLnrVDEn9Jho+pRAYMY8Wwomm P8ruG2h3mUkR+cUcu++vMgvPAVQ4IGqHIC1eAH5KzRwTDy+htW3DxgpC/uhNc4BLKzRq b78afRo2yEx/UdF4pJhgX/mJJgzDSlVeyTza1Okbwh2ehlA6oaVgqguE9MD6O79sDGO5 YnVSsAtyWymcZq6hIMficPJCtDWGRhGYvs9PiVwdqM/kjoApPPlV/ohEMMCZ9zK87HzV JAxxRghvnC+O0xWDztNWQD4EVoA1oHGq3GoIQypA0gtNuc++R6nubANIBDsHhrQYUZoH 3esQ== X-Gm-Message-State: APjAAAXrhzuywf23+bFzqQpeyK/W0C9PnPzVvqbgyN05JwxzzDfkXCCG K7FKukGoVbJq7/eOPhtrvcE1y12pVE0= X-Received: by 2002:a17:90a:1b0a:: with SMTP id q10mr20852490pjq.91.1566224545547; Mon, 19 Aug 2019 07:22:25 -0700 (PDT) Received: from localhost ([172.19.216.18]) by smtp.gmail.com with ESMTPSA id d2sm8465570pjg.19.2019.08.19.07.22.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Aug 2019 07:22:24 -0700 (PDT) Date: Mon, 19 Aug 2019 10:22:08 -0400 From: Joel Fernandes To: Frederic Weisbecker Cc: "Paul E. McKenney" , linux-kernel@vger.kernel.org, rcu@vger.kernel.org Subject: Re: [PATCH -rcu dev 3/3] RFC: rcu/tree: Read dynticks_nmi_nesting in advance Message-ID: <20190819142208.GA117378@google.com> References: <20190816025311.241257-1-joel@joelfernandes.org> <20190816025311.241257-3-joel@joelfernandes.org> <20190816162404.GB10481@google.com> <20190816165242.GS28441@linux.ibm.com> <20190819125907.GD27088@lenoir> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190819125907.GD27088@lenoir> 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 Mon, Aug 19, 2019 at 02:59:08PM +0200, Frederic Weisbecker wrote: > On Fri, Aug 16, 2019 at 09:52:42AM -0700, Paul E. McKenney wrote: > > On Fri, Aug 16, 2019 at 12:24:04PM -0400, Joel Fernandes wrote: > > > On Thu, Aug 15, 2019 at 10:53:11PM -0400, Joel Fernandes (Google) wrote: > > > > I really cannot explain this patch, but without it, the "else if" block > > > > just doesn't execute thus causing the tick's dep mask to not be set and > > > > causes the tick to be turned off. > > > > > > > > I tried various _ONCE() macros but the only thing that works is this > > > > patch. > > > > > > > > Signed-off-by: Joel Fernandes (Google) > > > > --- > > > > kernel/rcu/tree.c | 3 ++- > > > > 1 file changed, 2 insertions(+), 1 deletion(-) > > > > > > > > diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c > > > > index 856d3c9f1955..ac6bcf7614d7 100644 > > > > --- a/kernel/rcu/tree.c > > > > +++ b/kernel/rcu/tree.c > > > > @@ -802,6 +802,7 @@ static __always_inline void rcu_nmi_enter_common(bool irq) > > > > { > > > > struct rcu_data *rdp = this_cpu_ptr(&rcu_data); > > > > long incby = 2; > > > > + int dnn = rdp->dynticks_nmi_nesting; > > > > > > I believe the accidental sign extension / conversion from long to int was > > > giving me an illusion since things started working well. Changing the 'int > > > dnn' to 'long dnn' gives similar behavior as without this patch! At least I > > > know now. Please feel free to ignore this particular RFC patch while I debug > > > this more (over the weekend or early next week). The first 2 patches are > > > good, just ignore this one. > > > > Ah, good point on the type! So you were ending up with zero due to the > > low-order 32 bits of DYNTICK_IRQ_NONIDLE being zero, correct? If so, > > the "!rdp->dynticks_nmi_nesting" instead needs to be something like > > "rdp->dynticks_nmi_nesting == DYNTICK_IRQ_NONIDLE", which sounds like > > it is actually worse then the earlier comparison against the constant 2. > > > > Sounds like I should revert the -rcu commit 805a16eaefc3 ("rcu: Force > > nohz_full tick on upon irq enter instead of exit"). > > I can't find that patch so all I can say so far is that its title doesn't > inspire me much. Do you still need that change for some reason? No we don't need it. Paul's dev branch fixed it by checking DYNTICK_IRQ_NONIDLE: https://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git/commit/?h=dev&id=227482fd4f3ede0502b586da28a59971dfbac0b0 thanks, - Joel