Received: by 10.223.185.116 with SMTP id b49csp6150114wrg; Thu, 8 Mar 2018 02:39:36 -0800 (PST) X-Google-Smtp-Source: AG47ELvcFTBp5UcalmytokwqVq9T/CKU+wvshBg4mgCNtfpYex8nKcFDhS0SRfHiLxNLMgUoR2U5 X-Received: by 10.99.52.203 with SMTP id b194mr21391492pga.349.1520505576247; Thu, 08 Mar 2018 02:39:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520505576; cv=none; d=google.com; s=arc-20160816; b=DvoiusGS1SfIfQcCyusfF87mrLGi9JpSvstAwaW5z7qWoXjamq6V5LmeRYG4k8DFdu PYcqKYR2Bu/mAnFNIM5vzJhdXf9JJ0uR3vM6NM3tyGQaywuD2mqZO7+TxXkPkWufLx4Z iilmcpjb+WaVZvXTYB5g2LF99C+5wIEzkFlYtSnVgkccE0lcuU9TeXvRqRG+Jp+lp20P ceyTFYTNW9By0wTE0FXjdvIMNzZeV6qg0nloxo9C7CxbTc6kAN1BQ4WpG+WR7PunxVwf We0fezsrTZJ8YKKH1x2eBcoZAX4CGsgGcxSuCW9MSbHOkJ4Wt3EHHvZjUnr5a1g4Q60P 7+fQ== 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:arc-authentication-results; bh=o2G990QI7SCDOA1GYGDX1YtqqQZNi8Z0bxbisaNiopo=; b=vndt4THjNhCCyoQLBsll291sL+z3o50vHVWNToArVooc/xCF4CwTO4LmqUxNsF+x5g 3Pjc6J4M3d7+t20ZtMO8fMbqQd2rRbDYyPMHQpJjjXrtkOx/K0kjTEdVXH8fE3kvk7vh XFu+FzV7ojv1x5XvYToWjuS+gELPeFf2yDqzIkQLgs7TYwWyNJEWYKBLv2Cy1RkL12Es XuBz+M8SrMXe3H6duf7a0Ybz/rB2eM3kC+cAPgn+sYsX9kvc+Eild6qXGGDEfa/Ii2LW vljd8fMy+RskfyRQ/3UUwgtpSz500Cy3OXVIYwZHALXdO95uOgzszknK+B8fM9efP9Ct BbgA== ARC-Authentication-Results: i=1; mx.google.com; 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 i6-v6si14283671plt.437.2018.03.08.02.39.21; Thu, 08 Mar 2018 02:39: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; 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 S965249AbeCHKhK (ORCPT + 99 others); Thu, 8 Mar 2018 05:37:10 -0500 Received: from foss.arm.com ([217.140.101.70]:35698 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934059AbeCHKhI (ORCPT ); Thu, 8 Mar 2018 05:37:08 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 1934D1529; Thu, 8 Mar 2018 02:37:08 -0800 (PST) Received: from e110439-lin (e110439-lin.cambridge.arm.com [10.1.210.68]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id B2B433F53D; Thu, 8 Mar 2018 02:37:05 -0800 (PST) Date: Thu, 8 Mar 2018 10:37:03 +0000 From: Patrick Bellasi To: Peter Zijlstra 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: <20180308103703.GG2211@e110439-lin> References: <20180222170153.673-1-patrick.bellasi@arm.com> <20180222170153.673-5-patrick.bellasi@arm.com> <20180308094830.GK25201@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180308094830.GK25201@hirez.programming.kicks-ass.net> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 08-Mar 10:48, Peter Zijlstra wrote: > On Thu, Feb 22, 2018 at 05:01:53PM +0000, Patrick Bellasi wrote: > > +#define UTIL_EST_NEED_UPDATE_FLAG 0x1 > > > @@ -5321,12 +5345,19 @@ static inline void util_est_dequeue(struct cfs_rq *cfs_rq, > > if (!task_sleep) > > return; > > > > + /* > > + * Skip update of task's estimated utilization if the PELT signal has > > + * never been updated (at least once) since last enqueue time. > > + */ > > + ue = READ_ONCE(p->se.avg.util_est); > > + if (ue.enqueued & UTIL_EST_NEED_UPDATE_FLAG) > > + return; > > The name and function seem inverted, if the flag is set, we do _NOT_ > update util_est. My reading was along the line "when the flag is set we need an update of util_avg to collect a new util_est sample"... ... but I agree that's confusing... and unnecessary long. > How about something like UTIL_EST_UNCHANGED ? That would give: I would prefer UTIL_AVG_UNCHANGED, since the flags is reset when we have a change in util_avg, thus enabling util_est updates. > /* > * If the PELT values haven't changed since enqueue time, > * skip the util_est update. > */ > if (enqueue & UTIL_EST_UNCHANGED) > return; -- #include Patrick Bellasi