Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp417455imu; Mon, 26 Nov 2018 12:45:16 -0800 (PST) X-Google-Smtp-Source: AFSGD/W8eYRBkqKBxe5DJl8YkZBO7SEFGAsHYQIz+dojDIG2C2ut6OuAa1oDyv2BJflonsd7/5Em X-Received: by 2002:a17:902:6b49:: with SMTP id g9mr6541455plt.98.1543265116900; Mon, 26 Nov 2018 12:45:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543265116; cv=none; d=google.com; s=arc-20160816; b=mGwO6qwHvv3rV8oqWIi1C/mv4TAI7OVUFIy6wqbM2AQAhNypEAJWKv76FSoGW3sKJ6 4Qu0Ze0tr1b/wJ6bCeZLrsVbyMYQFCnjNvSG+zzKqbGLSvwBIPUNgaELHJPU0WN2gKXu UlDWHaSH9jHzV0qoTnsgyNrKlYLni865++UhZjs5t8z9FSKnez41LgT0yDPOp5XZqdb7 HBeZE490srXcAYvWXqISDj08JaD16fcXASlVvp7vZ4aTGtWtDvq49qMg+t8jYG3z8aWc oGxcpEPa3pYukDQqtYPKgidoDKECiHZhlCdJzj4whfov5nIX2bA7trjDh3jplObhO1RJ 3V5Q== 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=l0G64M9uGC+sdYGFFFBET6aKINgx/kW68vHvhaCG9MQ=; b=sFD0deHcesYo5sbqesC1pz9PNOJl6kqZvsvP6rg9r0CwrnjFGE2VxDqjmPlYYcloL8 ri78gVeUhamApgOK9qmX0OMsjVsjd1tvD3sEX604jQeJufqqKUeQPAR+qvSsJ/krVcrk vhuUO0mPCTkS/tIxoLMA19q0WT9xjc5k8+chmjk+ny3IDQ9fNY4E8lo1IiaEkKQBSs/9 O8klxSo4VTGXZVjRKogrCDhfnIvG8/tf07C1RQPKrar0t6pmoG+PyKReRYv01TIZb0PI lAKzcYFo7J0QBYch6OPIciwiA4Hh3Z13NAgV59YXn/D/DhMSNEnXJuiFGom+cXOpqia4 58+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=bH+Bktrq; 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 c32si1359381plj.38.2018.11.26.12.44.59; Mon, 26 Nov 2018 12:45:16 -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=bH+Bktrq; 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 S1727175AbeK0Hjn (ORCPT + 99 others); Tue, 27 Nov 2018 02:39:43 -0500 Received: from mail-ed1-f46.google.com ([209.85.208.46]:38142 "EHLO mail-ed1-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727056AbeK0Hjm (ORCPT ); Tue, 27 Nov 2018 02:39:42 -0500 Received: by mail-ed1-f46.google.com with SMTP id h50so17087901ede.5 for ; Mon, 26 Nov 2018 12:44:22 -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=l0G64M9uGC+sdYGFFFBET6aKINgx/kW68vHvhaCG9MQ=; b=bH+BktrqLaQ9khcspWq8dKtzHm+Q8rbNmfjrK4tL/zmjtU7TyIosaeaT6m+5Nh2KlU m931PnZptf1TG5WoFGOO+6533Pfm0IfFLkUBg1+ztD/ftnpgQPgZ6fOJjA4ZC8yF48j/ iz1iMhmxeqt+Q+BhJREjJMwj4VZzQlVC7WkXo= 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=l0G64M9uGC+sdYGFFFBET6aKINgx/kW68vHvhaCG9MQ=; b=IinWClEPscNl/m1mkeGgerIT8MOrD4FZ6eARrSud8teVesEJ9FQ5uQV4jBnmAeL+Oe Upx6phSIPx1dJfB/X9ZzfMT3hutjZJr6Cq4FnxKP6jEM+vIAffLnVynyULfhUh+sLw26 wpaLPqvYfpdZH9txDXJzvZAAU+k7BpOXJBQC4EUIxnMbcT9BqrqMIEud7UDApZQxUF1W xa7Ew2oG+Mi2cGW94loOt08vFg8PnFEu2cOw60QJKyw2rSNMP/4EMWh5GQJJJ2QQ1lHK PptEMadRGF3Qn5HiKCfTlMoggBHZUI4wBkYDM7XhJoEA1sVplO8SqiROCW1llL/1hiuO DYVw== X-Gm-Message-State: AA+aEWahJd9gdGbm/T3iKoI6f4tufHD0QXWdiptFpUCuZ+J/VzlQdZx8 EAjg77fyzRIycwRXgfzNxntzHg== X-Received: by 2002:a50:880d:: with SMTP id b13mr23726017edb.68.1543265061510; Mon, 26 Nov 2018 12:44:21 -0800 (PST) Received: from andrea (dynamic-2a00-1028-8386-da8a-eacb-c188-78b9-634c.ipv6.broadband.iol.cz. [2a00:1028:8386:da8a:eacb:c188:78b9:634c]) by smtp.gmail.com with ESMTPSA id c30sm418711edc.70.2018.11.26.12.44.20 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 26 Nov 2018 12:44:20 -0800 (PST) Date: Mon, 26 Nov 2018 21:44:14 +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: <20181126204414.GA4643@andrea> References: <20181121223453.GA4016@andrea> <20181126093051.GV2131@hirez.programming.kicks-ass.net> 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 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 ...) Andrea