Received: by 10.223.185.116 with SMTP id b49csp6082838wrg; Thu, 8 Mar 2018 01:17:11 -0800 (PST) X-Google-Smtp-Source: AG47ELszhz56X8DFMO3bxto9/hWjH1pF/1En44Zi2y4hVjyyNPXJoJuD/E3qQgyD3MGeXSIilPpd X-Received: by 10.99.95.81 with SMTP id t78mr20906416pgb.380.1520500631076; Thu, 08 Mar 2018 01:17:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520500631; cv=none; d=google.com; s=arc-20160816; b=IEJyD7b5AMxT+va+wet330Z2op2D3Sj4bJ5pmzIxfrIsK0Mp9l1v700+4Vw9aGaDtc f8TIE9Ktl2Hjd95La+N1Ek5Qcg3JsMmtdj1nlGJ04L4z1ebC8fSU/IbjslR6Q37BkXxA 5azXSsDA3ZljXN6dYIrfL85NOIdakjyVahye38OSBWmlYMWZo6s7rvkROyDa7pCI1K6S esIqWb+RbHPF+/4dk81hqxPUmqmqoDag32EU/8dhe3vGtnT2OpG/jGI9/eEqzIcuQSEe w1onk0MHDVpkN6z7Q84LL0Iaq/Tldz2wqVPiNpl4Y4NtK2Brxz1bzaiIJR5pAH3Qqq/G 4Hjg== 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=WIV7KPfTji0UTpu4dFfPqotmpzZ57kR9HkbbH8z1gJw=; b=ayL2fO7Z/J6hheD73dIIqTZqICMtTNw0MUEQwIFmXPMF/BgwBJxdcoYwZTLoDNCit3 XnBy1nRzz7+jsZvtzNa4w3TmaoEI4RrCvgdGWzdBWJYkiOWmpgKdsYtDgs7ihLY58HGL Ya6M+FE8yA7ziN8Ieyrs/kFFxIp74Nzx2UVg7+zPVbhszroP8kXDbQ9vLa93qVfaFp6i WzFaSUpSo6j0Q4YjcbTEX47w8UMhENrW+4wa6DRgZ/F/PVAQkb6hHfk3eJP1yHC0Qpec 2VsDG5vm4QFJ7YUhB4DuPnVAFAuMUrLaJV79xq658QJC1GkpLJNGby4A/N2xUdE84HxZ vbtA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=Chwflhcp; 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 e5si15461592pfl.5.2018.03.08.01.16.56; Thu, 08 Mar 2018 01:17: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=fail header.i=@infradead.org header.s=merlin.20170209 header.b=Chwflhcp; 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 S1755459AbeCHJPz (ORCPT + 99 others); Thu, 8 Mar 2018 04:15:55 -0500 Received: from merlin.infradead.org ([205.233.59.134]:55350 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755101AbeCHJPw (ORCPT ); Thu, 8 Mar 2018 04:15:52 -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=WIV7KPfTji0UTpu4dFfPqotmpzZ57kR9HkbbH8z1gJw=; b=ChwflhcperazRk7wvSEyESTwp ui9hkkF+0xAaho4rzOaU9VypLHsps6Zn4ftSatw1Xld+tLtoP8eitaDBpwqw/Bu1eRIrXvIBBha9D 4thZ32GvXYDOtFrH9kqze9vzkqnR2FCOygg0N4HJdvU4U1FtdniOI6MNkve98zZ15xOw2ba7pUjQ2 ll/PM8wourt5LZq5Bxw1jg0dEqfJWfdHwDREeQYLnepbthZBpKW5Ru3VEv8RWD4wUUFxw8TnauTfr +78ecrg8kDEY8B0hobo2UDHBc10HEGD8HPUBPiyGWa7hveOSpymw4XzXSoPfBWxjIVSVqvfG4N32x QAsgKe9LQ==; 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 1etreB-0007z1-VQ; Thu, 08 Mar 2018 09:15:38 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 85B252029FA14; Thu, 8 Mar 2018 10:15:33 +0100 (CET) Date: Thu, 8 Mar 2018 10:15:33 +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 4/4] sched/fair: update util_est only on util_avg updates Message-ID: <20180308091533.GA25235@hirez.programming.kicks-ass.net> References: <20180222170153.673-1-patrick.bellasi@arm.com> <20180222170153.673-5-patrick.bellasi@arm.com> <20180307103852.GJ25201@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180307103852.GJ25201@hirez.programming.kicks-ass.net> 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 Wed, Mar 07, 2018 at 11:38:52AM +0100, Peter Zijlstra wrote: > On Thu, Feb 22, 2018 at 05:01:53PM +0000, Patrick Bellasi wrote: > > @@ -5218,7 +5242,7 @@ static inline void util_est_enqueue(struct cfs_rq *cfs_rq, > > > > /* Update root cfs_rq's estimated utilization */ > > enqueued = READ_ONCE(cfs_rq->avg.util_est.enqueued); > > - enqueued += _task_util_est(p); > > + enqueued += (_task_util_est(p) | 0x1); > > UTIL_EST_NEED_UPDATE_FLAG, although I do agree that 0x1 is much easier > to type ;-) > > But you set it for the cfs_rq value ?! That doesn't seem right. > > > WRITE_ONCE(cfs_rq->avg.util_est.enqueued, enqueued); > > } > > > > @@ -5310,7 +5334,7 @@ static inline void util_est_dequeue(struct cfs_rq *cfs_rq, > > if (cfs_rq->nr_running) { > > ue.enqueued = READ_ONCE(cfs_rq->avg.util_est.enqueued); > > ue.enqueued -= min_t(unsigned int, ue.enqueued, > > - _task_util_est(p)); > > + (_task_util_est(p) | UTIL_EST_NEED_UPDATE_FLAG)); > > } > > WRITE_ONCE(cfs_rq->avg.util_est.enqueued, ue.enqueued); > > OK, so you unconditionally set that bit here to make the add/sub match. Clearly I wasn't having a good day yesterday.