Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp5657829imu; Mon, 26 Nov 2018 03:38:36 -0800 (PST) X-Google-Smtp-Source: AFSGD/WdUTCt6Ox73cjllbffbOJupL9rNFH6SVgolT3l3rbqHm3bvlEtr+bOz9qcmujVH8AqFab4 X-Received: by 2002:a17:902:b494:: with SMTP id y20mr25889426plr.178.1543232316897; Mon, 26 Nov 2018 03:38:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543232316; cv=none; d=google.com; s=arc-20160816; b=TACr/bcy8Bq1FkFmcLyOfxhz72be8fpz0bbEeiFccCrfZTjCXDxMQiFHVRQAfFm+UY CTea8LCilklr8KO2fCQUFUNbMOog+jXrPxbLtPkjP6Zt1Ees5VOUEyXKyJo9lHmbM2vB hetDeJApDCVVx2lg+CMkvEQVTSIZeB0E67DJl0zh0mk8Ak0Zd0dwBhzvC80WT+eERcb3 lWLKOSFKkPqEjE3CR/cLyHiUkL8BN+Hz603Pb+6w3MIDbiCUnsX1jLG1tHlOEEmtaznh QBRro/KGZ30vwcmXxZxhm7fFSYs+GGONL4iHYeVhdn9hmMm4hPyHIp+jrGS9SdIw7zTJ WpQA== 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=XwYANmgHfcI6YQtgJc52IlBnoMOIe7KeYXOfPHsP9vY=; b=enNRPJq8Qckol4puO2/eFtb/QBl/ra39wGE/s0TwuBrKG0V3JMehAtukvEV6qWnS15 jw/rVE+JcfyUpdo4Tgo8yyPYWNEbMS0mSsE9TRilFjJYiJX3k5rZggQpyhAKzec7P8yW yyV85Efn/piWSvqqAzj70HjBqOk49TYBzBhZb/yhMsFaFfqfa23jpOe3qb+kNedcc9hk 0VTZApbpwt5/UIqI/TWJXzfqqXuSDbj/jJ9wX08+dqU64/ZYNpH6AmkoOQtBoODydHIQ c8mcb8rZdGPrqlVSCyMW1z8YLCWNX5eR0xufr4SrFUVitPZxbTF6+I4pg5HqY5NIE5ly 4ylg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VqywoKhx; 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 j65si34925pge.444.2018.11.26.03.38.03; Mon, 26 Nov 2018 03:38:36 -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=VqywoKhx; 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 S1726476AbeKZWbE (ORCPT + 99 others); Mon, 26 Nov 2018 17:31:04 -0500 Received: from mail-io1-f44.google.com ([209.85.166.44]:39298 "EHLO mail-io1-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726225AbeKZWbE (ORCPT ); Mon, 26 Nov 2018 17:31:04 -0500 Received: by mail-io1-f44.google.com with SMTP id k7so3766916iob.6 for ; Mon, 26 Nov 2018 03:37:12 -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=XwYANmgHfcI6YQtgJc52IlBnoMOIe7KeYXOfPHsP9vY=; b=VqywoKhx6Mecj6d0abAo+RK+NmjALMmEjxpeTvkJBZsyo/y+2tDcBWog33v3NY/7m4 nw1+OIcmCI1Y0A9n7fki166zGVR/BgiqYaAqDfnwStCJShj02fDLhuTqG38WilRTxkOd obwvJ5ddcETErs8IB42XSYJ7MUQwYaDlf8Mcs= 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=XwYANmgHfcI6YQtgJc52IlBnoMOIe7KeYXOfPHsP9vY=; b=IBIYBT2h7xf1vyuswoGkBaWl35fqzr95oHTcjQ20aq0f49MxhA8PLay7C8pM5SPkoC mxgXCTzH+VNxENiFi4Vo83Gw7t3+JCKjaXv8LPlcgXvGWaspcyc+yc/j4VpKMqFkjrm/ /2O2V7/jN3mJi/tGicK0GHvKpLtXCVhyfbAloKsZDXvxa4wSW++5lXa7tLfJB+oAvPiy vI+/Qu26AbkJBGCfoFkAvQ2qtkbAaeh8Td/VVLDkMlbg/+ZfD/9DtEkCrum5+lPCiokB NOmql7HCk34JP6Jdj0PC35HD44ydSDvJ055+Sq6cG3Rm5sVWbqfEiAidCeAAMMBdEPqW MpNw== X-Gm-Message-State: AA+aEWYu/21vz9pthxw+6dyAqaXNwbqC78FMW555T6ye7Vc6YHRTAMtR 03Pl43MrQFxj7Auj9bfC+aaK9ODXzKZt9v0Od6tkPQ== X-Received: by 2002:a6b:fe13:: with SMTP id x19mr19666356ioh.294.1543232231796; Mon, 26 Nov 2018 03:37:11 -0800 (PST) MIME-Version: 1.0 References: <20181121223453.GA4016@andrea> <20181126093051.GV2131@hirez.programming.kicks-ass.net> In-Reply-To: <20181126093051.GV2131@hirez.programming.kicks-ass.net> From: Vincent Guittot Date: Mon, 26 Nov 2018 12:37:00 +0100 Message-ID: Subject: Re: [Question] atomic_fetch_andnot() in nohz_idle_balance() To: Peter Zijlstra Cc: andrea.parri@amarulasolutions.com, 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 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