Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp1051024rdh; Mon, 25 Sep 2023 01:24:40 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGyCJQ/2vu8fXLcUg696J003PBnN8jpuNfDcfM3Pk15Cy5E/hsQ+U+MfHpUKL7Lcs0AEeZL X-Received: by 2002:a05:6a00:2d82:b0:68f:d839:fb10 with SMTP id fb2-20020a056a002d8200b0068fd839fb10mr4701813pfb.2.1695630279828; Mon, 25 Sep 2023 01:24:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695630279; cv=none; d=google.com; s=arc-20160816; b=MX5oWk/FgmJN5K5UnCk+SqadFe7vR7qd7xlow0yEDfIAWLVmqoHGVwHnO8wi0KdbSc BKU9rZEoGUZ+hvj6VWnWGgPmDTq1oS09csRDO1K2qJ47C+N+jABqyCpjxzF7g/D2of1s ascHE4PO32WcDfJcoX8ePDD94Soavh/xzpo/jZ04AFw6ZO2o4ZCHsTNEzQjlgzniM6lw eSt3feb/aRd4utFrKZVCWy2UOVy/bh0wyHj1T8HjY9O0CYKVh5+qPlbFa4J62o1WsQTQ naxQRyoltiwUOO3/RFVwXlA5zUREyEtihRc7ujLfGVwblWZIIpjjlWHHkck1qXvkcpPq d4YQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=cowxUWPXQjH9rXomCyhqKk3MOFI575t/EUiMH5jv90Y=; fh=jF+j1UEDAwnYbShW3HmO1TshMsWh36Jt7pSLTP62NeE=; b=tzphzxOgJAeZDJe013uUKAWV6ogOdppKsruoXg1twUtPlTuXYtazXS0GGFrJQ3D7xy Ed7ktlFG30bQi84acSi0MjnTLlODWyBA8q2cQa2XZLrT1EkotjGRqNBIcmVD5yayaA1F jgfn5q3tuxDPPnPpuG+S98Lr1nfUE0frtFRuxxeBFFuFdzXs3FY+Qifs/erRATNZykCg FGQmLWv/VG94KM8D7Sy/VbcoSs0xS9PpBvcokmg5rNmVjNrPaOKu5vKO8der7+aGPSJe +eIuVtBnImP6eb3BLvvu8n5d9x0+uYB1pnBES5x2GfoI87skO0NngRB4+nUu7rEdZ08z BChg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 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 groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id g64-20020a636b43000000b00578fe1bdfcasi9272454pgc.860.2023.09.25.01.24.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Sep 2023 01:24:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 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 out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id B9FE680D6AF9; Mon, 25 Sep 2023 01:13:14 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232723AbjIYINA (ORCPT + 99 others); Mon, 25 Sep 2023 04:13:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56426 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232808AbjIYIMS (ORCPT ); Mon, 25 Sep 2023 04:12:18 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 0D483115; Mon, 25 Sep 2023 01:12:02 -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 D510CDA7; Mon, 25 Sep 2023 01:12:39 -0700 (PDT) Received: from e129166.arm.com (unknown [10.57.93.139]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 39C503F5A1; Mon, 25 Sep 2023 01:11:59 -0700 (PDT) From: Lukasz Luba To: linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, rafael@kernel.org Cc: lukasz.luba@arm.com, dietmar.eggemann@arm.com, rui.zhang@intel.com, amit.kucheria@verdurent.com, amit.kachhap@gmail.com, daniel.lezcano@linaro.org, viresh.kumar@linaro.org, len.brown@intel.com, pavel@ucw.cz, mhiramat@kernel.org, qyousef@layalina.io, wvw@google.com Subject: [PATCH v4 18/18] Documentation: EM: Update information about performance field Date: Mon, 25 Sep 2023 09:11:39 +0100 Message-Id: <20230925081139.1305766-19-lukasz.luba@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230925081139.1305766-1-lukasz.luba@arm.com> References: <20230925081139.1305766-1-lukasz.luba@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=0.5 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,TVD_PH_SUBJ_META1 autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Mon, 25 Sep 2023 01:13:14 -0700 (PDT) The Energy Model supports the new information: performance for each performance state. Update the needed documentation part accordingly. Signed-off-by: Lukasz Luba --- Documentation/power/energy-model.rst | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/Documentation/power/energy-model.rst b/Documentation/power/energy-model.rst index 3115411f9839..da3619c0b98a 100644 --- a/Documentation/power/energy-model.rst +++ b/Documentation/power/energy-model.rst @@ -125,6 +125,11 @@ runtime static EM' (system property) design to a 'single EM which can be changed during runtime according e.g. to the workload' (system and workload property) design. +It is possible also to modify the CPU performance values for each EM's +performance state. Thus, the full power and performance profile (which +is an exponential curve) can be changed according e.g. to the workload +or system property. + 3. Core APIs ------------ @@ -326,18 +331,18 @@ EM framework:: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ This section provides a simple example of a thermal driver modifying the EM. -The driver implements a foo_mod_power() function to be provided to the +The driver implements a mod_power_perf() function to be provided to the EM framework. The driver is woken up periodically to check the temperature and modify the EM data if needed:: -> drivers/thermal/foo_thermal.c - 01 static int foo_mod_power(struct device *dev, unsigned long freq, - 02 unsigned long *power, void *priv) + 01 static int mod_power_perf(struct device *dev, unsigned long freq, + 02 unsigned long *power, unsigned long *perf, void *priv) 03 { 04 struct foo_context *ctx = priv; 05 - 06 /* Estimate power for the given frequency and temperature */ + 06 *perf = foo_estimate_performance(dev, freq); 07 *power = foo_estimate_power(dev, freq, ctx->temperature); 08 if (*power >= EM_MAX_POWER); 09 return -EINVAL; -- 2.25.1