Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp2280325pxp; Mon, 21 Mar 2022 15:45:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJySajbwDzXNOjSQ1xFaayZTSb0csdg17cq5rWzXND0VyfD3+OmhRXk/xJBRvqCtWbv39UJs X-Received: by 2002:a17:902:c949:b0:154:5215:1db1 with SMTP id i9-20020a170902c94900b0015452151db1mr8106829pla.163.1647902745589; Mon, 21 Mar 2022 15:45:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647902745; cv=none; d=google.com; s=arc-20160816; b=atNXSVhnrRwmK+11FcptuMEh5VIT0xI0TpNTzwFfE31EKS+zgUeoI4VXGjvZKGbRIw ph6KcwoA5nCn1Cnls5S46x1sgiLxguI/NdVp724UIak150ZxQdvl+Ga3g18THAYMJGwn 97gof1mTZc2+6poVLFo7srrujCMGv6GknoVV95bpQzf3a/Uv4sLT5pFyWJ3ihKDJd4sy yvHH5RvDIjYcBUOf8eDhXmUAz1U2iw/ZCYGlZz0bBjm2FZjWzou55oQerACDCovHSh9A BN2cVIkCRRKHMQVz1c/oBoc22eB9V26hB4KW2sBQphlvJZpXmUgzP083RBQYfDJO2Omd LlFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from; bh=5nT5DHEGf9z1Nk9NHR4NfCTvNUXzk/g3/z9RP2Sz7WQ=; b=u9lEKhmCRYwJe/HUeNYjXXXGrbqneSDuI9y0a6IcePbSGTOxGwD0d+BnidSt1eNzuD KmQFFS0/E+g973vMPZoQ5IcIFOvkJi07Yu1rwRx5X8iiqBqZRLLlTpvYEyvWgKv2e2Nu dTdBudomGTHvVhh7SJ18j9Vz2lpyBGpJa6kQGp2ZbjjH0XjULUxstlMLiKAIhUAAOJUR btZTmemR9iFa1PQ8DfzWflw7DAsvQzMKz64kWtsGrLNMK8PmgQ6/OX/W6aDfMeK2FrV6 Vqj/zwak80s+9QiD2EHJog44H715oby5PJmEZ9Z3KXcktttb4Q2IUU0Xv3u7tXXShGGU 48QQ== ARC-Authentication-Results: i=1; mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id c17-20020a170902c1d100b001544c9777e0si5406761plc.95.2022.03.21.15.45.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Mar 2022 15:45:45 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 478293E19D4; Mon, 21 Mar 2022 14:53:49 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346154AbiCUJ7n (ORCPT + 99 others); Mon, 21 Mar 2022 05:59:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46454 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346153AbiCUJ7h (ORCPT ); Mon, 21 Mar 2022 05:59:37 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 4E96B25E90; Mon, 21 Mar 2022 02:58:06 -0700 (PDT) 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 10FD4106F; Mon, 21 Mar 2022 02:58:06 -0700 (PDT) Received: from e123648.arm.com (unknown [10.57.22.222]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 351C33F766; Mon, 21 Mar 2022 02:58:03 -0700 (PDT) From: Lukasz Luba To: linux-kernel@vger.kernel.org Cc: lukasz.luba@arm.com, dietmar.eggemann@arm.com, Pierre.Gondois@arm.com, ionela.voinescu@arm.com, viresh.kumar@linaro.org, rafael@kernel.org, daniel.lezcano@linaro.org, linux-pm@vger.kernel.org, mka@chromium.org, nm@ti.com, sboyd@kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, cristian.marussi@arm.com, sudeep.holla@arm.com, matthias.bgg@gmail.com Subject: [RESEND][PATCH 6/8] Documentation: EM: Add artificial EM registration description Date: Mon, 21 Mar 2022 09:57:27 +0000 Message-Id: <20220321095729.20655-7-lukasz.luba@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220321095729.20655-1-lukasz.luba@arm.com> References: <20220321095729.20655-1-lukasz.luba@arm.com> X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add description about new artificial EM registration and use cases. Update also the documentation with the new .get_cost() callback description and usage. Signed-off-by: Lukasz Luba --- Documentation/power/energy-model.rst | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/Documentation/power/energy-model.rst b/Documentation/power/energy-model.rst index fd29ed2506c0..feb257b7f350 100644 --- a/Documentation/power/energy-model.rst +++ b/Documentation/power/energy-model.rst @@ -123,6 +123,26 @@ allows a platform to register EM power values which are reflecting total power (static + dynamic). These power values might be coming directly from experiments and measurements. +Registration of 'artificial' EM +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +There is an option to provide a custom callback for drivers missing detailed +knowledge about power value for each performance state. The callback +.get_cost() is optional and provides the 'cost' values used by the EAS. +This is useful for platforms that only provide information on relative +efficiency between CPU types, where one could use the information to +create an abstract power model. But even an abstract power model can +sometimes be hard to fit in, given the input power value size restrictions. +The .get_cost() allows to provide the 'cost' values which reflect the +efficiency of the CPUs. This would allow to provide EAS information which +has different relation than what would be forced by the EM internal +formulas calculating 'cost' values. To register an EM for such platform, the +driver must set the flag 'milliwatts' to 0, provide .get_power() callback +and provide .get_cost() callback. The EM framework would handle such platform +properly during registration. A flag EM_PERF_DOMAIN_ARTIFICIAL is set for such +platform. Special care should be taken by other frameworks which are using EM +to test and treat this flag properly. + Registration of 'simple' EM ~~~~~~~~~~~~~~~~~~~~~~~~~~~ -- 2.17.1