From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.2 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_PASS,USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5B7C9C04AB1 for ; Thu, 9 May 2019 12:51:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2D44221479 for ; Thu, 9 May 2019 12:51:16 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="L/7bDbph" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726661AbfEIMvP (ORCPT ); Thu, 9 May 2019 08:51:15 -0400 Received: from merlin.infradead.org ([205.233.59.134]:58046 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726054AbfEIMvO (ORCPT ); Thu, 9 May 2019 08:51:14 -0400 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=t0R1VUJJpsY1eusaHX/1WZb8mvW8M0k/0c+bY4+19pk=; b=L/7bDbphkzq4BzbOgQs8HTsnG 0GBm3lkiGp7zTZbYCswxeJDVmOkma4KoRHropEotGvYjQmCM0HeoVx2CLF9Bb7pwFjqA/STo9r6ae /Itil4rq6feK6pSNYAe0ubtxQrThrLnz98WNVgF2lUIOWdCAjpkLvvfStCl7pKS4bPfYi5EvfPJgk UaSxkDOVGOK3JEP4VGPEBhjIc7HiFg6PAHRDbJ8e2YZnDrT65kdaER1wIYeYvv4FwjUVm+WGiNyge oHkL+lG6z7Az5XHSODakI72uVu/fzkynhCFKY/eAWGpcqSoxijxkf2ZvIk50xB/LOQiP6wYSfCZQi jgH3gWQkg==; 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 1hOiVu-0003BH-Qz; Thu, 09 May 2019 12:51:07 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 940FB22158200; Thu, 9 May 2019 14:51:05 +0200 (CEST) Date: Thu, 9 May 2019 14:51:05 +0200 From: Peter Zijlstra To: Patrick Bellasi Cc: linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, linux-api@vger.kernel.org, Ingo Molnar , Tejun Heo , "Rafael J . Wysocki" , Vincent Guittot , Viresh Kumar , Paul Turner , Quentin Perret , Dietmar Eggemann , Morten Rasmussen , Juri Lelli , Todd Kjos , Joel Fernandes , Steve Muckle , Suren Baghdasaryan Subject: Re: [PATCH v8 11/16] sched/fair: uclamp: Add uclamp support to energy_compute() Message-ID: <20190509125105.GU2623@hirez.programming.kicks-ass.net> References: <20190402104153.25404-1-patrick.bellasi@arm.com> <20190402104153.25404-12-patrick.bellasi@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190402104153.25404-12-patrick.bellasi@arm.com> 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 Tue, Apr 02, 2019 at 11:41:47AM +0100, Patrick Bellasi wrote: > @@ -6484,11 +6494,29 @@ compute_energy(struct task_struct *p, int dst_cpu, struct perf_domain *pd) > * it will not appear in its pd list and will not be accounted > * by compute_energy(). > */ > - for_each_cpu_and(cpu, perf_domain_span(pd), cpu_online_mask) { > - util = cpu_util_next(cpu, p, dst_cpu); > - util = schedutil_energy_util(cpu, util); > - max_util = max(util, max_util); > - sum_util += util; > + for_each_cpu_and(cpu, pd_mask, cpu_online_mask) { > + util_cfs = cpu_util_next(cpu, p, dst_cpu); > + > + /* > + * Busy time computation: utilization clamping is not > + * required since the ratio (sum_util / cpu_capacity) > + * is already enough to scale the EM reported power > + * consumption at the (eventually clamped) cpu_capacity. > + */ > + sum_util += schedutil_cpu_util(cpu, util_cfs, cpu_cap, > + ENERGY_UTIL, NULL); > + > + /* > + * Performance domain frequency: utilization clamping > + * must be considered since it affects the selection > + * of the performance domain frequency. > + * NOTE: in case RT tasks are running, by default the > + * FREQUENCY_UTIL's utilization can be max OPP. > + */ > + tsk = cpu == dst_cpu ? p : NULL; > + cpu_util = schedutil_cpu_util(cpu, util_cfs, cpu_cap, > + FREQUENCY_UTIL, tsk); > + max_util = max(max_util, cpu_util); > } That's a bit unfortunate; having to do both variants here, but I see why. Nothing to be done about it I suppose.