From patchwork Mon Sep 25 08:11:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lukasz Luba X-Patchwork-Id: 144275 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp1054437vqu; Mon, 25 Sep 2023 01:21:10 -0700 (PDT) X-Google-Smtp-Source: AGHT+IErli9PY8Sn/9PcsCDG4q70jY0chXen9KBQgOsaOUg+qqQAgLFci1WBmc205u47oLVOH7tN X-Received: by 2002:a81:4941:0:b0:586:cf7:2207 with SMTP id w62-20020a814941000000b005860cf72207mr5747867ywa.14.1695630070056; Mon, 25 Sep 2023 01:21:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695630070; cv=none; d=google.com; s=arc-20160816; b=g8JUjJtoVSPnjmbpIDpxBPwivd9jWlGWgjUAXe9nH1OdhJCa2QI7bKXc+Fg/bYRmHT hR3zHlKoEGZDoLM+hqG1Bn3oQGD8ABXZPD+RGoLxlfAHoKtae7sJFFlBIElGTJLOwiPe IT+NYCKZdY+eIkDUpIpLIaLmjGkBdv5vqqPz/Y32XjNYp1IO21w6FMaSxnvtbZs04mC7 yiBm/zs4Gn8kbiYmBt4DqCFMqR3hjs+xmokeNE1vKWPvsnQfXl1KOhJ+T02MYQa60Bko /kgjva0hKBHDBB6ob/MkXf1Xwjqj1oC1z98pAuSsjnhJKFDt7lbjbiWRQKA9bd2/beIv PxIA== 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 23.128.96.37 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 snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id u191-20020a6385c8000000b00573f9dbef8asi9792408pgd.266.2023.09.25.01.21.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Sep 2023 01:21:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (Postfix) with ESMTP id 8701C80190BC; Mon, 25 Sep 2023 01:13:01 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232752AbjIYINB (ORCPT + 30 others); Mon, 25 Sep 2023 04:13:01 -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 X-Spam-Status: No, score=-0.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_NONE,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 lindbergh.monkeyblade.net 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 (snail.vger.email [0.0.0.0]); Mon, 25 Sep 2023 01:13:01 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777996996474921606 X-GMAIL-MSGID: 1777996996474921606 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;