Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp676979imu; Tue, 27 Nov 2018 04:51:11 -0800 (PST) X-Google-Smtp-Source: AFSGD/Wkqnx18y5W0xQuIi9QuSFyvpq14QkmtFLITC/2nwoWj+2JEU1TXEBBDVfSdKNAN33Jxjac X-Received: by 2002:a65:47ca:: with SMTP id f10mr29785832pgs.166.1543323071796; Tue, 27 Nov 2018 04:51:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543323071; cv=none; d=google.com; s=arc-20160816; b=J2UxTEhIeWaIuV6b8gkLSNRbebeChQW/fWHOnR34gQrpn0KADXzf2PtymQO0C4gfUe V9EiQfmgyDpYLga1+B7qApV8skOddUP4GKDotzVXg2dI/BwXT8kCKlzYPHZMzQF5f7G5 eH2OyOY+MrswKdaJWkptJ/b7YiMvrrMMXNCC3DTWsP8xRQnIo8Y5VX7k43irCA11XGby vO3pdopPz4bYh9nPdMBo7bfztRKSD6xTPtf2YNEfeVAMwaj7cMlLCGfWLRyxo6T/1Kte B/EQ08qDtkIMsaT1kEBklbXuHZqrUP8SP4tyhM5oRYI/OWAECTSL8Ah0xk+5ETHLBgjr fUDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=17OMeXdA+cn8HDvQagvMUiDn7pfkIoSy4U5d6D8C3Nw=; b=Jzc+YvEI86tBn7TuthEYXXjf4YuezX8EzCzXHxqreQAvDEGV5sv6vFag0ALIUp4+Sg wRR3MyIVdIab43lkqKxzHONBufVwHL0+5pjZrJj3e/z0VLKxtZ9k7w4n2okZu+3wnsNQ EKDb6i8hw5UbWBfyTia2ZayIItHhvBggqVj70ePtvwOlKvNDMXjaoTQT7B+T6JLEySUh hZYq2YZsU/zT+CDo2a6w2I+7ZDsLoRUiwH4DMWRwYphk57SRlycjceYl9m6bda/mSiUF oc3Y/tb/W3J6njNm57cA19EM9n+2ajPVQdcfg6QjyANc12kQr2pPOmdAnvwaVCsyH4mv 302A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=C4OWCfft; 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=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a11si4058965pln.78.2018.11.27.04.50.56; Tue, 27 Nov 2018 04:51:11 -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=@linaro.org header.s=google header.b=C4OWCfft; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729892AbeK0T6t (ORCPT + 99 others); Tue, 27 Nov 2018 14:58:49 -0500 Received: from mail-io1-f46.google.com ([209.85.166.46]:42055 "EHLO mail-io1-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729387AbeK0T6t (ORCPT ); Tue, 27 Nov 2018 14:58:49 -0500 Received: by mail-io1-f46.google.com with SMTP id x6so16357443ioa.9 for ; Tue, 27 Nov 2018 01:01:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=17OMeXdA+cn8HDvQagvMUiDn7pfkIoSy4U5d6D8C3Nw=; b=C4OWCfftDFbmkfQ8BcCdth7LFlC4eQ629TA5KpmSfJmm8024F4wI/AB+2OUGjUvkKF 1apaZAGyaMVF9MMAA+q+IRyfjs9EqIW1KPzs6Amvwd2CfKlADy0xclNn2Na99GYdU4js 3zIn0kEMPrUsEZ/PfpkXEXgtU69vxeKtEEpTw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=17OMeXdA+cn8HDvQagvMUiDn7pfkIoSy4U5d6D8C3Nw=; b=cWZ/PGqMBaK4120Jii682v2ST5J4+R2einaQRmLx7fuLNO9npvegxUybNVOIxZFL+d 1ctkVwzzgkd3+/KQszNrW9nS6jXsIPoJGOGHT9lAM/DIHG21HKXHxbVPt+RUsZOUr+y8 5Iz8TEpjqdFv7wKHxvY0M6tkizqA94WxbWsKxuAYt4IuCbiTXvJly1ovrgoYkusL8Vti c1emX6kUq/fHezeV4akchbsXfiRhPRo9Tyh8uggm9gxfN0JRBFvVgNbQckmH0VSSdW0X C7O/8Le/04AYq7i/334K17kIksgmCKphPFnt9gYIBscq0EtRyV6bkReW4GAejQhpc0AY /lrg== X-Gm-Message-State: AA+aEWbC4uVqVUA45JgVtTYdwm50GypzjtkUfpWjA9EoYb141QJGB8uR pQDyxIIq9PosbRXgAPoYEje+V3ubvb0H9KoJ/4hE/g== X-Received: by 2002:a6b:c8c9:: with SMTP id y192mr22690561iof.183.1543309295825; Tue, 27 Nov 2018 01:01:35 -0800 (PST) MIME-Version: 1.0 References: <20181121223453.GA4016@andrea> <20181126093051.GV2131@hirez.programming.kicks-ass.net> <20181126204414.GA4643@andrea> In-Reply-To: <20181126204414.GA4643@andrea> From: Vincent Guittot Date: Tue, 27 Nov 2018 10:01:24 +0100 Message-ID: Subject: Re: [Question] atomic_fetch_andnot() in nohz_idle_balance() To: andrea.parri@amarulasolutions.com Cc: Peter Zijlstra , Ingo Molnar , linux-kernel Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > > Andrea