Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp2678115ybl; Mon, 19 Aug 2019 06:01:35 -0700 (PDT) X-Google-Smtp-Source: APXvYqxXeEDZ7acuec/F+yxcYwzASZzwKJEovFUMStRRflyWfUZwbliXM14rZB3mgvHaiM8LG1hJ X-Received: by 2002:a17:902:ab8f:: with SMTP id f15mr22600019plr.301.1566219694950; Mon, 19 Aug 2019 06:01:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566219694; cv=none; d=google.com; s=arc-20160816; b=QawpRP5RRfTq0Q3F6cxCwqBR+q2SncUQJOcHu52aF3fC2cDGW8Yj7Cdreo4+IzcXQS Z7338FM0hKVR7oz4fg0e/BactNUlsgyMD9IleOjyanoBMRdufXwLxolKp3t70vZS1H2G OXnEtAUQuMe0jQZTbX5m/e3B6BoJ01D2xJxmzpq++0fD3/vy0tampM48xxjY/6TsS2Eg FF0G4VSL8Hh3GRDx1R9MVQGeM+/JkH2or2al2e8G5o/vhU/0npeGahnYp/xnq8AsUpf4 C3eM+aHGOs+XL4M1qGCcxyJ7OONvo4oxZLl6EF+UQuhD31LSy6d51s/73AcyFM4HVn+Y CCPA== 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=W2pex9Y02N3ZiSejp1H87g1Xt3bM6il/eNjdfhHJc9A=; b=LnHQ8NqU2d0XeeAvIoKPFN7Qdo3EtMhe5UKn/JUfp6WWIo17pgTmdyGuGjsEa+AiO/ QTL6XCuG8BxfY+Et2vxUF11nuaUWLYeCfL8/p3+CpR64hwosAWTnqzoWKZa2Wm/fke34 mcEUzPJK5LA42u286AOl/TIWf6O8yHkGEAM17bCxs2zSpmHZE3PZWxjHGIUDeMlLka+/ QqBR4Ep2Pvo9Eab7YifLkM/oK0nfh3Ridtb5+Awi45rjsuUyYHGEjICZvUK7sHL6mUXW mbT4d2HScvbQSHQJsa4QV3Gz+a7wvRxU98aR/RkOODwdF5etJNUan4pOI0DYwZjyafos lzEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=c4p8ugCE; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x5si10565528pfq.86.2019.08.19.06.01.19; Mon, 19 Aug 2019 06:01:34 -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=@kernel.org header.s=default header.b=c4p8ugCE; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727548AbfHSM7L (ORCPT + 99 others); Mon, 19 Aug 2019 08:59:11 -0400 Received: from mail.kernel.org ([198.145.29.99]:39516 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727128AbfHSM7L (ORCPT ); Mon, 19 Aug 2019 08:59:11 -0400 Received: from localhost (lfbn-ncy-1-174-150.w83-194.abo.wanadoo.fr [83.194.254.150]) (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 25D77205C9; Mon, 19 Aug 2019 12:59:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1566219550; bh=Sh3TbivVvIcuc2WU4oim5kaxlQu+I/qgCqID/+7+3hk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=c4p8ugCETs7favaQpvlGpiSd+m/7kISZJrc0vUQ7oFESvYbRbkP//FpHJR8wpgOho x+R17XbgRQUJw7vNcV6mG1XwrT7VlQ88BqRmza+dlReIgycUY9eg/SRqPJHkkPIXem Pu7wcbkm8A3R6lYcKcM4LQLFhkkk4j5KzQt2ffWs= Date: Mon, 19 Aug 2019 14:59:08 +0200 From: Frederic Weisbecker To: "Paul E. McKenney" Cc: Joel Fernandes , 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: <20190819125907.GD27088@lenoir> References: <20190816025311.241257-1-joel@joelfernandes.org> <20190816025311.241257-3-joel@joelfernandes.org> <20190816162404.GB10481@google.com> <20190816165242.GS28441@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190816165242.GS28441@linux.ibm.com> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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? Thanks.