Received: by 10.223.185.116 with SMTP id b49csp4176803wrg; Tue, 6 Mar 2018 11:04:04 -0800 (PST) X-Google-Smtp-Source: AG47ELtObHwebwWsTmiWaK6fV4DQBqKlJsgfvLC8THqf1YojB4GZ8rD/x/2TmqOvBtl0Os5Lm3Mx X-Received: by 2002:a17:902:2823:: with SMTP id e32-v6mr17770071plb.44.1520363044031; Tue, 06 Mar 2018 11:04:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520363043; cv=none; d=google.com; s=arc-20160816; b=yEjpYeWRfn8gOcuRC3CLssx7brOpdB6lLsxPqUNDm5elfZ0Vb7ue5Cv0YF9IE/tcDU zVNGLt6vbyfkuBratGu/4YiBmKBWQXzU3WCQeZ2MBodSC/bLgDbI+4SWz0mBnqcpm10Y OzY0E5Gl5idNv5og1Of4prlgN/lpqZp4v3qjdk7B39G8DnZnt3MUIBbNVDPxV7hfewql Xe+NmqO9Kmsu8JpcMkylyTa04MOo+LuKYx5AsGDi4k5Q+SRRWCG3FbgQ7zt/cwCM77IL gDkodPtqIaRGWNAdNnvJxazNjVUhQvzTZtT1sitzcxyhx+/Uj80ksk7t1gldYASuziDv 2ouQ== 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:arc-authentication-results; bh=9GHdtqIeNUspw/xsPN2NAWYuKCRGx0K0vHy6TvJAkVs=; b=aHcX+olHIJjSryvXe6PtRrWnvn8Z1Ybo06tZQ0recwO00xQ/N8i0e8L0i/VhkNDxbG /n4X+PwT3hOJF+NbVwTGjDXhFS8a5GAFy5NzvY1IqOtlvEAK6U/mJBVOcsGryaEcEpPR AsLijGWSjUExEvjVyvJbChx7J5JBlKHLqKVJg4e+hnTxfs3pzTlJDcfo6E+74AItvp6u GBiXeanvDX4gE9BKKVvZsYm9eVQ2aYt9JciiXzwXlUFOOBKP7Vu9aAh97/72T7BdVUyJ yAIeIjWf2Ap9CuRLyMw2JRJ1uUTgWHotUeT7YUy8w9owAbdeyUtbKPBQwDG7G9mW9Nw6 WClw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=ZUHz/dsv; 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 38-v6si11480243pln.397.2018.03.06.11.03.48; Tue, 06 Mar 2018 11:04:03 -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=ZUHz/dsv; 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 S1753987AbeCFTCv (ORCPT + 99 others); Tue, 6 Mar 2018 14:02:51 -0500 Received: from merlin.infradead.org ([205.233.59.134]:38398 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753807AbeCFTCu (ORCPT ); Tue, 6 Mar 2018 14:02:50 -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=9GHdtqIeNUspw/xsPN2NAWYuKCRGx0K0vHy6TvJAkVs=; b=ZUHz/dsvfazcbbe2Br/IWnJd3 R01yLrgoq0+L8s36QvHhtrJi3tTMiKMPJTR4xrCYeaQxEYCQfvwZN5xP0MisNAPoMLtXqE5iwWB1i D5ndUYIr1xPpcfy3rM3MUDNan2BBTpL3D1FUF4B5jT+xRnd55giwWSa/mSbSewAdVFEEGYxU4zjvy 6s35Znf+PvQIt1KZECTtvwh9XoCxaYAm52LfQncEfqpZ6YSNgj8QzVcMjx+k7MnpYK3UchU9Is6Do IkCLtGvbcTKDydokNOZ1XJBFRPG8zngg03tXWz9Vn1/2Lt895qehta89zp6M+AKursUoHRdEnvgwS NRkmy8YKw==; 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.89 #1 (Red Hat Linux)) id 1etHrG-0004En-Jx; Tue, 06 Mar 2018 19:02:43 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 6B17D2029FA14; Tue, 6 Mar 2018 20:02:41 +0100 (CET) Date: Tue, 6 Mar 2018 20:02:41 +0100 From: Peter Zijlstra To: Patrick Bellasi Cc: linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, Ingo Molnar , "Rafael J . Wysocki" , Viresh Kumar , Vincent Guittot , Paul Turner , Dietmar Eggemann , Morten Rasmussen , Juri Lelli , Todd Kjos , Joel Fernandes , Steve Muckle Subject: Re: [PATCH v5 1/4] sched/fair: add util_est on top of PELT Message-ID: <20180306190241.GH25201@hirez.programming.kicks-ass.net> References: <20180222170153.673-1-patrick.bellasi@arm.com> <20180222170153.673-2-patrick.bellasi@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180222170153.673-2-patrick.bellasi@arm.com> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Feb 22, 2018 at 05:01:50PM +0000, Patrick Bellasi wrote: > +struct util_est { > + unsigned int enqueued; > + unsigned int ewma; > +#define UTIL_EST_WEIGHT_SHIFT 2 > +}; > + ue = READ_ONCE(p->se.avg.util_est); > + WRITE_ONCE(p->se.avg.util_est, ue); That is actually quite dodgy... and relies on the fact that we have the 8 byte case in __write_once_size() and __read_once_size() unconditionally. It then further relies on the compiler DTRT for 32bit platforms, which is generating 2 32bit loads/stores. The advantage is of course that it will use single u64 loads/stores where available.