Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp321048pxj; Thu, 10 Jun 2021 01:20:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwJAMnF4xDMICLjeeYj4GCOQh8NHOYwydBjzrxzEf0bYMZIzc7k4TFcc4zKuOVZCTFwOxfD X-Received: by 2002:a17:906:4c8c:: with SMTP id q12mr3412491eju.254.1623313235860; Thu, 10 Jun 2021 01:20:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623313235; cv=none; d=google.com; s=arc-20160816; b=cVr5CLSZe9peAj6Z9+7qeLJcaZ8nr1qhyNCwz9pizusZWQfBnNsbShR86RX0uuGABH ci9pjeoZmWFmzyfnf4LVXhrgIDmHOpux6M6ukTdQxCKtqvMedC4NwVYKpUsSre8XAD47 LJgpsPdI2wpqrw5BCvqSqiaTgrwZx0Ryr1YH97p3haYesPk1jc0I//EaBRqtF/KQYbAo SrweQB02zEubTzk0+4Qq0ZNaTgxcA1hz7SfR88wDfrWdHJhFL0hYPD+O6rSzr52gs41S FI7fkRdbiOzyrsohNl/NBw9je/aknxwHWhTcNdtjTmF6j+GU619l5VbLif+RFWdiX4Ii 8Q1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=eK/urZ/LFmI8AWXBqa8VyW63lbnMUjnPkwj2jwSFDZw=; b=H7cObvr7+ad3jG3roeC966Lluy2xYOkNvob1k1unPuYFQTjojVUlsk1feeyp4v3zwX QGFbgx0OYL5+l7BYAH6MCNCGALWF943KPX4edgHq7KglLZgs2CSpksQ10JqocN7PxC0B 4IHjYVsoJMoXLg30X6j7Od9E942eRLeJcNz528uGeXqcpNf7kRvfQe4HxFMWvi9NeA1l FzMQYrOqrDQ6/HQ7UEadjltClD8IPRTz7zYrqCrA56Z86svba1Nri1/HTJRyiyTs9yFh e95Q/wS5pmLLL5Bnimf+95O9rLC6h7qPEjB8sv4tC6jh5cngxEu/PbQEJF+im4iMCLyU fKAQ== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 19si1849926edw.341.2021.06.10.01.20.12; Thu, 10 Jun 2021 01:20:35 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229941AbhFJIVJ (ORCPT + 99 others); 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