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=-5.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=no 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 B4FABC433E2 for ; Wed, 16 Sep 2020 09:19:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 839ED2076C for ; Wed, 16 Sep 2020 09:19:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726543AbgIPJS7 (ORCPT ); Wed, 16 Sep 2020 05:18:59 -0400 Received: from foss.arm.com ([217.140.110.172]:57150 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726691AbgIPJSo (ORCPT ); Wed, 16 Sep 2020 05:18:44 -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 CB8D7101E; Wed, 16 Sep 2020 02:18:43 -0700 (PDT) Received: from [10.37.12.50] (unknown [10.37.12.50]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id A00853F718; Wed, 16 Sep 2020 02:18:41 -0700 (PDT) Subject: Re: is 'dynamic-power-coefficient' expected to be based on 'real' power measurements? To: Matthias Kaehlcke , Daniel Lezcano Cc: Rajendra Nayak , Rob Herring , DTML , Doug Anderson , linux-pm@vger.kernel.org, Amit Daniel Kachhap , Viresh Kumar , Javi Merino References: <248bb01e-1746-c84c-78c4-3cf7d2541a70@codeaurora.org> <20200915172444.GA2771744@google.com> <406d5d4e-d7d7-8a37-5501-119b734facb3@linaro.org> <20200915175808.GB2771744@google.com> From: Lukasz Luba Message-ID: <6b5f3130-a9e7-3240-b5ab-63f87e0d53d3@arm.com> Date: Wed, 16 Sep 2020 10:18:39 +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: <20200915175808.GB2771744@google.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org On 9/15/20 6:58 PM, Matthias Kaehlcke wrote: > On Tue, Sep 15, 2020 at 07:50:10PM +0200, Daniel Lezcano wrote: >> On 15/09/2020 19:24, Matthias Kaehlcke wrote: >>> +Thermal folks >>> >>> Hi Rajendra, >>> >>> On Tue, Sep 15, 2020 at 11:14:00AM +0530, Rajendra Nayak wrote: >>>> Hi Rob, >>>> >>>> There has been some discussions on another thread [1] around the DPC (dynamic-power-coefficient) values >>>> for CPU's being relative vs absolute (based on real power) and should they be used to derive 'real' power >>>> at various OPPs in order to calculate things like 'sustainable-power' for thermal zones. >>>> I believe relative values work perfectly fine for scheduling decisions, but with others using this for >>>> calculating power values in mW, is there a need to document the property as something that *has* to be >>>> based on real power measurements? >>> >>> Relative values may work for scheduling decisions, but not for thermal >>> management with the power allocator, at least not when CPU cooling devices >>> are combined with others that specify their power consumption in absolute >>> values. Such a configuration should be supported IMO. >> >> The energy model is used in the cpufreq cooling device and if the >> sustainable power is consistent with the relative values then there is >> no reason it shouldn't work. > > Agreed on thermal zones that exclusively use CPUs as cooling devices, but > what when you have mixed zones, with CPUs with their pseudo-unit and e.g. a > GPU that specifies its power in mW? > These two (pmW and mW) shouldn't be combined in one thermal zone with IPA as a governor, but IPA will try to recover. It will be more unstable meaning the OPPs capping might jump from lowest to highest, which will be spotted in the testing. For example, we have CPU with abstract scale where max is 10 and GPU with real mW max = 2990. They both have the same 'weight' = 1. Let's say IPA is seeing 3000 as a total budget and splits it: 10/3000 * 3000 = 10 2990/3000 * 3000 = 2990 Which means both actors can run at max speed. Unfortunately, the real consumption of the CPU could be ~4000mW. The temperature in the next period will rise above the threshold for which the budget was estimated. Next time both devices are likely to be capped at minimum freq because there is no budget and temperature is to high. After a while the PID would realize this and try to recover, but this shouldn't be the main solution. Regards, Lukasz