Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2862679pxj; Mon, 14 Jun 2021 08:50:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy1g7/UinyZLY077em78XhwY5LpmsA17n4jug3Z6GM2WEmkLHsg0AiThazWCgdcq2qkFw0W X-Received: by 2002:a50:9345:: with SMTP id n5mr18056816eda.289.1623685826628; Mon, 14 Jun 2021 08:50:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623685826; cv=none; d=google.com; s=arc-20160816; b=W3lN3R8VOQlg1PW1GuwvwvxHC/GHCsQa9VrNkmSeztx31OyTXSl5BCfN5JCpUeHiQq lqS8fwf8/ObjvStugLv9znMTCBYrTYLbjJZ55BM44dnPfpJuBdspT9ndbb2mB+vlcgIc pqByoh+lJkFG9QWVaDJP/mIMZy8m2mSh/QKw4ljBf7CKG3+tj/8j29Dtk3JFLR0A2S3n OrAGL3oWXJOvxT05tGgzoLpKowlb+qnNWKF/HZo5LSlI7eLDUI7P8qmpwT3AYaWRFqRm 5RbWht4R0k/IC6vUrYuBqEQGbObApHiG1bUuPiWmASPq/9HGWAcYU3LPlM6rA4yn353I RfSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=BvxA21VumxeBH80QU+YFcZjpYmFJP2YEnOU9brfcC/Q=; b=hiw3Bb/H/TkKiv1XjLDOxoLThPhkRFvLelL36f4GgNShUeyiWCu5t5jA90Gj29W4K1 OXHHfj7ooOFbZ4VcKDdOVDO3QhWRa9rsrf2cxj0fvICsyTklg6sHqO/+v8+cTMM3zGpE 1APgDZSNYiZsaMC89SxmEbTIOppAcoLu1E3n5RL5cqvW6JGHPencAbpK2Rp5hy9iX3ya RxUF22FQJ1P2wE2K7R4C4p6VYbI2wUbvS8viphpahD4R4r5+hEVkULYw84qa4HV+Zmdm HwMq72mCdJy7uSHFl6QeY5foz74N9WXZmi1PkmJKwrS3D49XeqdpqsR/XndJODvw2tqb eOWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ov3+e6Xc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 11si11958494ejf.43.2021.06.14.08.50.04; Mon, 14 Jun 2021 08:50:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ov3+e6Xc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233152AbhFNPvP (ORCPT + 99 others); Mon, 14 Jun 2021 11:51:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45832 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233035AbhFNPvP (ORCPT ); Mon, 14 Jun 2021 11:51:15 -0400 Received: from mail-lj1-x234.google.com (mail-lj1-x234.google.com [IPv6:2a00:1450:4864:20::234]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E8ACBC061574 for ; Mon, 14 Jun 2021 08:49:11 -0700 (PDT) Received: by mail-lj1-x234.google.com with SMTP id k8so3912592lja.4 for ; Mon, 14 Jun 2021 08:49:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=BvxA21VumxeBH80QU+YFcZjpYmFJP2YEnOU9brfcC/Q=; b=ov3+e6XcGW7aaTgitcXgtvPoIULYqS4OqrYI5NXLHClAO16OfPyuCdmO7oUzbB28/H gnbpQAf6lHGUsrfpiqjqCgd9aNJD9pwFRPL0alRWw9U2qb7IEe1DbA5apv1b85+0YQRI fPGBmONGKxwlX/8gkRyO/vXXjiNE+mJzYbMPtt3KlNBDE547jiPlu+4o1lT/czrP+VdA zYWXsFZU7WgMWs0TY+3JRQPoF+VPj5NmeRDIFB7Ilmtz5XaFBxsUkgF51mXrbRvsmSFJ KdLw88W3xU2OhiBJdEyQ+0c4qfxTGwO1puVM0UB9ZE4qGoS+QDgB/MMQG4hH3N7wMF/D UOiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=BvxA21VumxeBH80QU+YFcZjpYmFJP2YEnOU9brfcC/Q=; b=s1nYxoQdFQ7W/axx9hdgHx4BVJj6+NIvc637MpH78ygoWgiLbTM9z15iPSRuOyZx3c 8xuoHeDBV0HlU08JPaBdNgIkV1OafSlRvm/4BcClfSYyspdzfYbijGRRBTRpZRfNFVlw w9JjGi5byGuqlXw3YDf7kqvwpYoxMUlfgnDRnbTqO9/9ZXDTPen8+wMC8BerN+JX7caQ 1BsmixAhwLGZrQZ9Q4ks9j8f7M3UoKH4lPUpRbdUJAR1NgAUrh0te+O11+R/+1JB/Gg3 35YDjr1URUmTj6QZ0tMTGJlpcOP9xRE5R6jKrCz/pzqGHkPKdfpT2daJS9yqQly7bgy6 0oeQ== X-Gm-Message-State: AOAM531m7oF09su2B2LMtJcdryx6Ufavq62tSbB5HJHlBtf+Ufbxjx2k RH3Gzfm+bL5pcIieXhZftFTxvSwos6vz9cDeJWb6Ww== X-Received: by 2002:a2e:8046:: with SMTP id p6mr6984068ljg.401.1623685750313; Mon, 14 Jun 2021 08:49:10 -0700 (PDT) MIME-Version: 1.0 References: <20210610150324.22919-1-lukasz.luba@arm.com> <20210610150324.22919-3-lukasz.luba@arm.com> <81d7bd73-a61a-5501-f8ec-77e195355013@arm.com> In-Reply-To: <81d7bd73-a61a-5501-f8ec-77e195355013@arm.com> From: Vincent Guittot Date: Mon, 14 Jun 2021 17:48:58 +0200 Message-ID: Subject: Re: [PATCH v3 2/3] sched/fair: Take thermal pressure into account while estimating energy To: Lukasz Luba Cc: linux-kernel , "open list:THERMAL" , Peter Zijlstra , "Rafael J. Wysocki" , Viresh Kumar , Quentin Perret , Dietmar Eggemann , Vincent Donnefort , Beata Michalska , Ingo Molnar , Juri Lelli , Steven Rostedt , segall@google.com, Mel Gorman , Daniel Bristot de Oliveira , Thara Gopinath , Amit Kachhap , amitk@kernel.org, Zhang Rui , Daniel Lezcano Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 14 Jun 2021 at 17:29, Lukasz Luba wrote: > > Hi Vincent, > > Gentle ping. Could you have a look at this implementation, please? Ah yes, this has been lost in my inbox. Let me have a look at it > > > On 6/10/21 4:03 PM, Lukasz Luba wrote: > > [snip] > > > @@ -6527,8 +6527,12 @@ compute_energy(struct task_struct *p, int dst_cpu, struct perf_domain *pd) > > struct cpumask *pd_mask = perf_domain_span(pd); > > unsigned long cpu_cap = arch_scale_cpu_capacity(cpumask_first(pd_mask)); > > unsigned long max_util = 0, sum_util = 0; > > + unsigned long _cpu_cap, thermal_pressure; > > int cpu; > > > > + thermal_pressure = arch_scale_thermal_pressure(cpumask_first(pd_mask)); > > + _cpu_cap = cpu_cap - thermal_pressure; > > I've done the implementation according to your suggestion. That should > provide the consistent usage. > > Regards, > Lukasz