Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp5525934imu; Mon, 26 Nov 2018 01:31:50 -0800 (PST) X-Google-Smtp-Source: AFSGD/UEutE9b6xsQeN2hyOI0Uhr9k9aO/KgxNK4YcgOi2/sWNQJA2g1043C9q3fKXsPK18mr5UV X-Received: by 2002:a63:d301:: with SMTP id b1mr24205896pgg.61.1543224710773; Mon, 26 Nov 2018 01:31:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543224710; cv=none; d=google.com; s=arc-20160816; b=KPZ1Pz8g1hvbfSTI2q7t9ICWKFnllWjGPw2ykLufYVmhAqYLsu7ChEQJIMCGsJBYMV b4byObXsEhwoANoEOIcLbjdAHNDgndjLW7oMrUNraS59Lr6xPZzGJPY9Qn66EPgahNW/ g5mtspi3wRslvB5ENbEckfRyDZBEry+HkMlf4K5TdOofglDT9fxZ13gM3WOL+L6Y4cua vJW7ILslsTF/e1b5UMYck0fjxr/1zP61cDNvHxtG9ohmuRZQv01As9DytUBfbtMQYQ93 xPVMZrtIHdQ7w/qWjXxFHkpkVUfwnqd5p7d4YEhPO9w8zHxAptVfXmw6cxiiu5Jo35GO bDeA== 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=y1C+U3er+UTlKWMSDrMoXJRVyFZ2s3zavNVn7l21m0s=; b=gFBe0b77rPXtmRZfrpd3VgPO66j6AhAqt8lJxBL9yLJn7RSAYBLb/seeIY56g3y6/V iQ7RpAzWoW3qGzR4U3e4V+akHLGwzo/ubCTjyZntnzE2wKB/iKjiZv1NyTQnHu+Q6qI5 nOl/VWPo1uElEbn6Ml4VHzv9mS2tN3pECoF5h3GJHMsr04C9vT9CKL4T1FSKB4d3DQEg DRec4oRvQcIuWLNScQdtbvf3wLZCPQVg+MY87T1oG6JScbk15+uiBhQecMe1atImj+Tu 69tQ7WIU3PaujYnosuUbYnEQyeFUkHm0jNnmZydWZFy3dyQ8htGrIDPfup987CpJQY5o 7/6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=V48fmEF+; 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 g59si23185932plb.302.2018.11.26.01.31.35; Mon, 26 Nov 2018 01:31:50 -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=fail header.i=@infradead.org header.s=merlin.20170209 header.b=V48fmEF+; 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 S1726237AbeKZUYa (ORCPT + 99 others); Mon, 26 Nov 2018 15:24:30 -0500 Received: from merlin.infradead.org ([205.233.59.134]:57514 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726157AbeKZUYa (ORCPT ); Mon, 26 Nov 2018 15:24:30 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=y1C+U3er+UTlKWMSDrMoXJRVyFZ2s3zavNVn7l21m0s=; b=V48fmEF+h1ktF+ZVDbb/JgJ1k npJa4Rwh3YyICk9O6afzD2C7SGzdDQa1oCYETRdTt7VvfQD5xDv5Sy0m+vqkrzIBL4SIIkXI64V6Z kS4tpH8UZ7j7gPF1wJWCAubfWcX8dH4DYxQpLPcsmp+kXKOjDeN8OHKWHbXlr/PPREQ8UHAQv2f4b AggJbrNEIZK6N54vrQisSf5CEAgrKLZGIhkOaJpW8h18cIMozRFcEKs2jQDTaAATx/kA6jIZpWZK6 UaEemmDn0mbZsw9saZiPao1DTzpFhb84Vp7LsEDP4I6ydqiTXWfaetGQXbPOpM4o6LPkIdrFjwdFu bOtqPzSsw==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1gRDEE-00069R-UF; Mon, 26 Nov 2018 09:30:55 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 837D62029FD58; Mon, 26 Nov 2018 10:30:51 +0100 (CET) Date: Mon, 26 Nov 2018 10:30:51 +0100 From: Peter Zijlstra To: Andrea Parri Cc: Ingo Molnar , Vincent Guittot , linux-kernel@vger.kernel.org Subject: Re: [Question] atomic_fetch_andnot() in nohz_idle_balance() Message-ID: <20181126093051.GV2131@hirez.programming.kicks-ass.net> References: <20181121223453.GA4016@andrea> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181121223453.GA4016@andrea> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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?