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=-10.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=unavailable 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 3277FC48BD1 for ; Thu, 10 Jun 2021 08:19:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 14674613CB for ; Thu, 10 Jun 2021 08:19:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230055AbhFJIVJ (ORCPT ); Thu, 10 Jun 2021 04:21:09 -0400 Received: from foss.arm.com ([217.140.110.172]:53208 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229715AbhFJIVI (ORCPT ); Thu, 10 Jun 2021 04:21:08 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id B4E9CD6E; Thu, 10 Jun 2021 01:19:12 -0700 (PDT) Received: from [10.57.4.220] (unknown [10.57.4.220]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id D786C3F719; Thu, 10 Jun 2021 01:19:09 -0700 (PDT) Subject: Re: [PATCH v2 2/2] sched/cpufreq: Consider reduced CPU capacity in energy calculation To: "Rafael J. Wysocki" Cc: Linux Kernel Mailing List , Linux PM , Peter Zijlstra , "Rafael J. Wysocki" , Viresh Kumar , Vincent Guittot , Quentin Perret , Dietmar Eggemann , vincent.donnefort@arm.com, Beata.Michalska@arm.com, Ingo Molnar , Juri Lelli , Steven Rostedt , segall@google.com, Mel Gorman , Daniel Bristot de Oliveira References: <20210604080954.13915-1-lukasz.luba@arm.com> <20210604080954.13915-3-lukasz.luba@arm.com> From: Lukasz Luba Message-ID: <6b10f1ed-17d7-e1b0-37c5-17ced9ba383c@arm.com> Date: Thu, 10 Jun 2021 09:19:08 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 6/9/21 4:01 PM, Rafael J. Wysocki wrote: > On Fri, Jun 4, 2021 at 10:10 AM Lukasz Luba wrote: >> >> Energy Aware Scheduling (EAS) needs to predict the decisions made by >> SchedUtil. The map_util_freq() exists to do that. >> >> There are corner cases where the max allowed frequency might be reduced >> (due to thermal). SchedUtil as a CPUFreq governor, is aware of that >> but EAS is not. This patch aims to address it. >> >> SchedUtil stores the maximum allowed frequency in >> 'sugov_policy::next_freq' field. EAS has to predict that value, which is >> the real used frequency. That value is made after a call to >> cpufreq_driver_resolve_freq() which clamps to the CPUFreq policy limits. >> In the existing code EAS is not able to predict that real frequency. >> This leads to energy estimation errors. >> >> To avoid wrong energy estimation in EAS (due to frequency miss prediction) >> make sure that the step which calculates Performance Domain frequency, >> is also aware of the allowed CPU capacity. >> >> Furthermore, modify map_util_freq() to not extend the frequency value. >> Instead, use map_util_perf() to extend the util value in both places: >> SchedUtil and EAS, but for EAS clamp it to max allowed CPU capacity. >> In the end, we achieve the same desirable behavior for both subsystems >> and alignment in regards to the real CPU frequency. >> >> Signed-off-by: Lukasz Luba > > For the schedutil part > > Acked-by: Rafael J. Wysocki > Thank you Rafael! Regards, Lukasz