Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp3527781pxb; Mon, 4 Apr 2022 20:01:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyhQF7ascZ4rvD795HxDHHFuc5WJFHX4iZeBJY/V6uztlXJ92U0GEhV6UaxacFc7fYSiOyB X-Received: by 2002:a17:90b:3b8c:b0:1c6:eb72:24b4 with SMTP id pc12-20020a17090b3b8c00b001c6eb7224b4mr1504406pjb.171.1649127684420; Mon, 04 Apr 2022 20:01:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649127684; cv=none; d=google.com; s=arc-20160816; b=xy0ZyxU8qeDku1sToOiI46zx0jKaLD57KLFibU2LKLhwFN3vPLVVG7LxXiuBF1//mp Joiw26ZsiF+6Gv9zNkhzfDq63YUBWs5RQVxw8Cz0hEf1MsE6U5W7A1zZ/9OxLMSm8k8z NBMzHy6WFUR1aha9oeQYmV0Xx3cHvsuiRsgfSjMyvWljPySIL0k5axGX2mRSis86nzSZ ntRHNzy1NqIN6PgjHH25I8+KTk4I/6yPzWpB1nXdmHKxdxSpZ1aVKE1hiBsDLLKWjR7X FZQz2WcrBpKx/t7bcS7AQXsXPA0c9HrOkyczJTywV6dnUqc/uH1MKH3qN72py6BT5qJ/ wK7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=iPC93TgjzT68nribd6R+6PiOcc2we9b/4+A8+ug5QCQ=; b=Utf77HMgco0NNwK5NmJZqwjcxxFc8TerXR+B05kjurysdUg0JzZlSy7btnCAsO0NiI PSlCrGZpiVwU+6Z1w8IThM+SpL6DSmJoyYCsqPI0w91cUjJ3maBfw5rmlpEVwheXxiZw EisqqV8dEaaZq1JrodJ29zq7l1AQ4yYsKfofCwEeGzglD+zRoe53al+IhWt4yjwn6M+U Y+oHsA2OzMt36YE/FtwZhW4HMV1b1UKyzlRfCGtbCBU2fvLcwtagMI9Ju134DHZZhbD+ FAYNUuofs/O0YSoCmioHt18OPxvFUkwT2dle1eMnlDtgeewDznoA4S75d7Z/cT9/jjlf uYwA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1: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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id s13-20020a170902ea0d00b00156a03969e8si5285115plg.307.2022.04.04.20.01.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Apr 2022 20:01:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1: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: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id DFD5A2F7EA9; Mon, 4 Apr 2022 18:25:55 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1383507AbiDDVdc (ORCPT + 99 others); Mon, 4 Apr 2022 17:33:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38546 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1378880AbiDDQEm (ORCPT ); Mon, 4 Apr 2022 12:04:42 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 81D4B427DE; Mon, 4 Apr 2022 09:02:46 -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 4D8B6D6E; Mon, 4 Apr 2022 09:02:46 -0700 (PDT) Received: from localhost (ionvoi01-desktop.cambridge.arm.com [10.1.196.65]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id E7E173F73B; Mon, 4 Apr 2022 09:02:45 -0700 (PDT) Date: Mon, 4 Apr 2022 17:02:44 +0100 From: Ionela Voinescu To: Lukasz Luba Cc: linux-kernel@vger.kernel.org, dietmar.eggemann@arm.com, Pierre.Gondois@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: Re: [RESEND][PATCH 6/8] Documentation: EM: Add artificial EM registration description Message-ID: References: <20220321095729.20655-1-lukasz.luba@arm.com> <20220321095729.20655-7-lukasz.luba@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220321095729.20655-7-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 Thanks for documenting this as well. On Monday 21 Mar 2022 at 09:57:27 (+0000), Lukasz Luba wrote: > 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 Maybe it worth adding a note here that the power values provided with .get_power() are only for information purposes and that they don't have any functional use. > +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 > ~~~~~~~~~~~~~~~~~~~~~~~~~~~ > Reviewed-by: Ionela Voinescu > -- > 2.17.1 >