Received: by 10.223.185.116 with SMTP id b49csp4861550wrg; Wed, 7 Mar 2018 02:13:50 -0800 (PST) X-Google-Smtp-Source: AG47ELv/1ccMM8S1NwOkOQI6RsoEKw04pa1dKtJ5pj0eElkqEd8fiMsROoaF4SdutSIDYCJ3ev8R X-Received: by 10.99.145.194 with SMTP id l185mr17227241pge.394.1520417630556; Wed, 07 Mar 2018 02:13:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520417630; cv=none; d=google.com; s=arc-20160816; b=DQELfWNP0W5F+hej7AfKQixIqdbQVpfFRyynMZpVl/DZcrU8WvIcTCzlBCaLnUHfS6 vrCeC8YYgI/MahJXgb0ZXAp0ToT+KXgQnftmbd6HO0WEP++5Nix//sg9ZY8uN1GZKdG/ lN0WEy3WLf4GSrHfg7LlllHX0OvasZcwl32at49P7fFkyOlym3M+Yy6CfDXpjjJL0vMS IImHYtCyTjdnZHlrG+4DNvgpnO+HLvzk+JOB5BWfaGopOs+3WHvBHP3QaQl9DlXdP9CY ONbjgv1IhoPV/euFJ9LaKhrI3KOrl37lwsaWBweLiB6SktN9r44RLKQwIjrm+c7N0sJ1 mA9w== 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=cVMm8ptuvL3ElcmrFBUdeg7cJYHhtEVqOKv2Cd9Y4Pc=; b=IRrGi7mjWjFWRdbheideuZuP4aoGElkatawjaHzKDK7IQb4hMjF5TGeg3B8/J5iJYN Jj0+RxPLroAO5pEWWkwquNWpGnwNv3RNbS6Xm48/xY7V82CB0T9EPmGxcnhofsEE1N2X 6xI9Sm9ZIYykETcyaCUF5txKkDDfp6sXQD1rGwEIU2WAU2j9neJ7AVryNas+dgxMtYYg hChsPlTXF0WOnay9rD9CAHyLrxKiVXF5QIcFdO0QU95chTkS9+/OPhe8VzKlOYbHrzXj Hf4yfw0VlmpFx4rektUHr5CB6JE4Y61vnQt6367LqWbrRFmUsnR1r9YSQ398sB5iXQyZ R4YQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=AAiZRpvB; 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 e4si11169324pgp.516.2018.03.07.02.13.35; Wed, 07 Mar 2018 02:13: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=AAiZRpvB; 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 S1754244AbeCGKMj (ORCPT + 99 others); Wed, 7 Mar 2018 05:12:39 -0500 Received: from merlin.infradead.org ([205.233.59.134]:43164 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751127AbeCGKMh (ORCPT ); Wed, 7 Mar 2018 05:12:37 -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=cVMm8ptuvL3ElcmrFBUdeg7cJYHhtEVqOKv2Cd9Y4Pc=; b=AAiZRpvB3zzYrpw+Lm1xK4pY5 QQkFHmpBvFoJmwd3Cp2A+sSBsfbk6HDKq9YPpSKJiepVtOyK8paUiHA9BgT2qBmxTg8BGFK5kopuO MUGBuRVc4705TYawr8m8sLsxn8KzvlSOLsG26rVW/xSpbfzdLWLqsqGufs/9cj/0ElbJYuxoic7TE Hgh1okX6kL2W2Xohh33HL8ffp2lA7FUaYPdOKGIP1X+NVMnj13oB7Ik708aCUjqAiclaeRpnom0An 8/7lbCkaiB6ttqC0ryJqPV3bUZfW1VmqJubPUIaLKzHYluYJTw7dK/WHtEz3XyJRzhPD6skHpJjNp 8BR4/nUWw==; 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 1etW3V-0002nn-Fu; Wed, 07 Mar 2018 10:12:18 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id BD3732029FA14; Wed, 7 Mar 2018 11:12:14 +0100 (CET) Date: Wed, 7 Mar 2018 11:12:14 +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 3/4] sched/cpufreq_schedutil: use util_est for OPP selection Message-ID: <20180307101214.GI25201@hirez.programming.kicks-ass.net> References: <20180222170153.673-1-patrick.bellasi@arm.com> <20180222170153.673-4-patrick.bellasi@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180222170153.673-4-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:52PM +0000, Patrick Bellasi wrote: > static inline unsigned long cpu_util_cfs(struct rq *rq) > { > + if (!sched_feat(UTIL_EST)) > + return READ_ONCE(rq->cfs.avg.util_avg); > + > + return max_t(unsigned long, > + READ_ONCE(rq->cfs.avg.util_avg), > + READ_ONCE(rq->cfs.avg.util_est.enqueued)); > } static inline unsigned long cpu_util_cfs(struct rq *rq) { unsigned long util = READ_ONCE(rq->cfs.avg.util_avg); if (sched_feat(UTIL_EST)) { util = max_t(unsigned long, util, READ_ONCE(rq->cfs.avg.util_est.enqueued)); } return util; } Seems like a more readable variant.