Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp646792imu; Tue, 27 Nov 2018 04:20:28 -0800 (PST) X-Google-Smtp-Source: AFSGD/UozOD3Ql7V2v8iIiwCgHAkMqgOUeKcmrkIbWFzdgWMx+hZpS91tpx5PKyGozcCeKu7rtXx X-Received: by 2002:a63:2946:: with SMTP id p67mr29525252pgp.317.1543321228427; Tue, 27 Nov 2018 04:20:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543321228; cv=none; d=google.com; s=arc-20160816; b=jN9BmrQdY4vm9k9ujm5LSO6YyppebLJxJhRZ1C7DlkK5OF/5d+vmIJ1y9g8PtTqYOU nqON4B6plTETpvMOP0VmlAMsp1b/8ha1lkKyIoEL0akccx4azvsRItSjgniiiuMWi4xH IWmsZE9SJqXYkPkfU9w6bldoOBkc6+UB6b1SK5YlpjLfaF6oJRs1LFtfbqIe7P+Ggyv5 j/xjNr76zMIKWCzZRJiVADcJnQnD2x6KJ0kGbEl4qDrPgRuyHyYZK5C/pC4lKFOJm08Y V83lPRO1q4nZrPONN5BMVLk8MirAMDC6vtHydoUwxWAsFViSHEOc2tDednIEkPPjZODb eiGg== 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=ejdvGjdynfjwDyOYSvsWobTBWc8XsmggwGTMHO1rrrc=; b=ddJuwzESHhTGdj9vYjL/aRrTorv/Z0ODhdX7hYzSse3xizq/GbFyduH5huWzvx4Z1Y juxUsF6//7tRt1i6cgC4tbNj8G7y5ujlErwzJrzSoORwIQggSXIgR6Uitsjh36WpLcSs OPKcvLJ4AH6ifVWucvVm++9dxoN5ftLdtYBAAiWn7xGMeU/VHQUCR+Blry97eVWZahhZ LTSS1u/6rPuVVyHg8HuYX8QEMTRQmWS58mGDcErpe6sy7bDFnWr3NFRyHcI0A8UUd1GQ eg0qDY9CRmch3qveJo8f0bcvDri2dye3M7uaQXcQGTo5WQ/237rb+JbJP+eqMaKdepbp YGQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=XGD5lKTo; 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 n67si3961635pfk.34.2018.11.27.04.20.01; Tue, 27 Nov 2018 04:20:28 -0800 (PST) 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=@amarulasolutions.com header.s=google header.b=XGD5lKTo; 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 S1729008AbeK0V53 (ORCPT + 99 others); Tue, 27 Nov 2018 16:57:29 -0500 Received: from mail-ed1-f47.google.com ([209.85.208.47]:35095 "EHLO mail-ed1-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726564AbeK0V53 (ORCPT ); Tue, 27 Nov 2018 16:57:29 -0500 Received: by mail-ed1-f47.google.com with SMTP id x30so18624113edx.2 for ; Tue, 27 Nov 2018 02:59:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=ejdvGjdynfjwDyOYSvsWobTBWc8XsmggwGTMHO1rrrc=; b=XGD5lKToakyJX1oRbQ62pqrRsRBiB4sCTlzami5JwDDhJtrbqUnIfKJp3+6gACzTd3 Hy4Kus5wvBxh6ds8SlACohNEiM2gRMiVFDrdT3vE/n790RMrEiC7NuVq6upRm/WyN1uC k9L+036gIKitcZjOJla01jFZawGP3tKSGT880= 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=ejdvGjdynfjwDyOYSvsWobTBWc8XsmggwGTMHO1rrrc=; b=fJ4GZlpJy0ih+B0YZcnOF7BGbuncJnIV8YufWmDFIXATdfHJ8XitTXrt8xdTg5poYH ZrvzyZwqzSQ4svMaoHUrjLfcEv6VDThadCMDD+PlCoTOH1CQlNSnoCm5CdTbx0b/ySHl 6gmGwMcOgCg/jnzzYY0ev5gFBxX6o9gN2FSdm3TNtlRYpgUaHIlo+Na2FbkKGZFSzNq4 X+pl94nOxLgN6AvrlDeS+3bHrUR6jRaheub7RRqSYWCdRWE8arOueq7d/V8N/U2OMbX7 9/YHCtYi2YoOhQHNcn72Hmt62+BHIcbHQnRDMNfVl6qgLR2ZSD0TdMndRK3T54VkGDCM EB2A== X-Gm-Message-State: AGRZ1gKHoZFeuTB1+sp2EBD4/J3B3lg6lscpF1ewp/J64mhiIWbyv6jy rUEuQrQlVwoDUAffwrK/pPCIFw== X-Received: by 2002:a17:906:6c97:: with SMTP id s23-v6mr22948184ejr.79.1543316396712; Tue, 27 Nov 2018 02:59:56 -0800 (PST) Received: from andrea (85.100.broadband17.iol.cz. [109.80.100.85]) by smtp.gmail.com with ESMTPSA id c29sm899438eda.75.2018.11.27.02.59.55 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 27 Nov 2018 02:59:56 -0800 (PST) Date: Tue, 27 Nov 2018 11:59:50 +0100 From: Andrea Parri To: Vincent Guittot Cc: Peter Zijlstra , Ingo Molnar , linux-kernel Subject: Re: [Question] atomic_fetch_andnot() in nohz_idle_balance() Message-ID: <20181127105950.GA5398@andrea> References: <20181121223453.GA4016@andrea> <20181126093051.GV2131@hirez.programming.kicks-ass.net> <20181126204414.GA4643@andrea> 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) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Nov 27, 2018 at 10:01:24AM +0100, Vincent Guittot wrote: > On Mon, 26 Nov 2018 at 21:44, Andrea Parri > wrote: > > > > On Mon, Nov 26, 2018 at 12:37:00PM +0100, Vincent Guittot wrote: > > > On Mon, 26 Nov 2018 at 10:30, Peter Zijlstra wrote: > > > > > > > > On Wed, Nov 21, 2018 at 11:34:53PM +0100, Andrea Parri wrote: > > > > > Hi, > > > > > > > > > > The comment for the atomic_fetch_andnot() in nohz_idle_balance() says: > > > > > > > > > > "barrier, pairs with nohz_balance_enter_idle(), ensures ..." > > > > > > > > > > which, well, does sound a note of warning... ;-) > > > > > > > > > > I see that nohz_balance_enter_idle() has an smp_mb__after_atomic() but > > > > > the comment for the latter suggests that this barrier is pairing with > > > > > the smp_mb() in _nohz_idle_balance(). > > > > > > > > > > So, what is the intended pairing barrier for the atomic_fetch_andnot()? > > > > > what (which memory accesses) do you want "to order" here? > > > > > > > > I can't seem to make sense of that comment either; the best I can come > > > > up with is that it would order the prior NOHZ_KICK_MASK load vs us then > > > > changing it. > > > > > > > > But that would order against kick_ilb(), not enter_idle. > > > > > > > > Vincent? > > > > > > I can't come with a good explanation. > > > After looking into my email archive, the only explanation that i have > > > is that the comments remains from a previous iteration of the feature > > > that was based on a nohz.stats_state mechanism > > > > I'm afraid I still can't help your comment... put in other terms, would > > you feel "unconfortable" with _relax()ing the andnot()? (and if so ...) > > so I think that the comment is useless and can be removed because it > was referring to a line code above the comment that was present in a > previous iteration of the patchset. This line disappeared in final > version but the comment has stayed. > > If your question is: can we use atomic_fetch_andnot_relaxed() instead > of atomic_fetch_andnot() in nohz_idle_balance() ? > I think that it's possible Ah!, thank you for the clarification. Just sent a clean-up patch for the comment (but deferring for the _relaxed() change...). Andrea > > > > > Andrea