Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp2223632pxp; Mon, 21 Mar 2022 14:16:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxzv0l0JrTOrVYikO3avrA/L0JUYpi9iVUc9uGN0dT0EkwQ2tf23LNLp3Ds2Xqz+7jajy9p X-Received: by 2002:a17:902:f782:b0:14b:63db:9bc1 with SMTP id q2-20020a170902f78200b0014b63db9bc1mr14633961pln.60.1647897372582; Mon, 21 Mar 2022 14:16:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647897372; cv=none; d=google.com; s=arc-20160816; b=J6wi3YhKaAJV+HP93eUb7+nTKYRCM7TEbwMcxN9vEFRSa7hM6DwQ3eLl+IoX5nZH1m nK+l0HJBM6EIRk1fo/d+N9RAw8J8Ri5VVNzFfPs0pJ7DoINoM7Dc2QXi+aMECiar2a8K sarJMvSOxuZFC54XNIq2psX1ZxEgGvBOrHukYhnXWPu98/UENdOoJ4W73oIgSbvQ0f0M 1gE0ReWINfAEyazO2VZfJLXt3fjaU6YV7KpZ+yzMcehkg/yKdKs42qfxIkla6ph/ZOnt MeToInsw93RzNuW2indXBYNupFjpUeLuGR+RhGYBFU6eYv+ZZi2a1NbAAJFuIc9xMa95 xwoQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from; bh=B+7AIuuyjDIM45fY5BwtkkxwbNTKSFuMTPtWzeatNNg=; b=yADbqgDORmprLgUf2zCjG7f2XlFGVszI2JjTVjqSohxgRgCW69rD/uIpiEYLzsgwhk gr+hCVi3MOBz60JemBVgTPvd0LZIoYu6Czqnd1MoHiaT0grRpWq96Di6gamnJFz5rOg+ Tg9+eCL0/QMHte2jYX4GKV5HIic7JfhyD1JzAoLw02QM8zKbRIiSiwTseDgI+bQYEXln BuA5fw84b+BzShzajez60MxjuIhULZJIrLNkD+U4cVtShyqKWo+fn2EG9TVsEdkTuuIv X1lBlDTnUQHtGgoiVJQSDlXVhWSB2GwqiKp2R4lEOEeSW/y/kT3lrPcng0Spk/qrQdQH K2ZA== 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 13-20020a056a00072d00b004fa3a8e0001si8363879pfm.184.2022.03.21.14.16.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Mar 2022 14:16:12 -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 2B9F28FE5F; Mon, 21 Mar 2022 14:03:48 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239608AbiCUJ7P (ORCPT + 99 others); Mon, 21 Mar 2022 05:59:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45410 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233295AbiCUJ7N (ORCPT ); Mon, 21 Mar 2022 05:59:13 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 6D41D137029; Mon, 21 Mar 2022 02:57:47 -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 EBD5C1042; Mon, 21 Mar 2022 02:57:46 -0700 (PDT) Received: from e123648.arm.com (unknown [10.57.22.222]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 125BC3F766; Mon, 21 Mar 2022 02:57:43 -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 0/8] Introduce support for artificial Energy Model Date: Mon, 21 Mar 2022 09:57:21 +0000 Message-Id: <20220321095729.20655-1-lukasz.luba@arm.com> X-Mailer: git-send-email 2.17.1 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 Hi all, This patch set adds new callback and support for artificial Energy Model (EM). The new EMs have artificially generated performance states. Such EMs can be created from lean information sources, such as the relative energy efficiency between CPUs. The ACPI based platforms provide this information (ACPI 6.4, s5.2.12.14 'GIC CPU Interface (GICC) Structure' 'Processor Power efficiency Class' field). Artificial EMs might require to directly provide the 'cost' of the generated performance state. This patch set adds a new callback .get_cost() for this. The EM framework does not force any model or formula, it's up to the platform code. Artificial EMs aim to leverage the Energy Aware Scheduler (EAS). Other frameworks relying on performance states information (i.e. IPA/DTPM) must be informed of the EM type and might be prevented from using it. This patch sets also does this by introducing a new flag: EM_PERF_DOMAIN_ARTIFICIAL. The patch set is based on current linux-next, where some changes to OPP & EM are queuing. The patch set also contains (patch 7/8 and patch 8/8) logic which prevents two EM's client frameworks from using this new EM type. Some other approach, using 'milli-watts', has been proposed and discussed, but refused [1]. This new flag is more precised and should not leave space for wrong interpretation. Shortly after this patch set you will see a patch set implementing the platform code and registering this new EM. Regards, Lukasz Luba [1] https://lore.kernel.org/linux-pm/20220207073036.14901-1-lukasz.luba@arm.com/ Lukasz Luba (7): PM: EM: Add .get_cost() callback PM: EM: Use the new .get_cost() callback while registering EM PM: EM: Change the order of arguments in the .active_power() callback PM: EM: Remove old debugfs files and print all 'flags' Documentation: EM: Add artificial EM registration description thermal: cooling: Check Energy Model type in cpufreq_cooling and devfreq_cooling powercap: DTPM: Check for Energy Model type Pierre Gondois (1): PM: EM: Add artificial EM flag Documentation/power/energy-model.rst | 24 +++++++++- drivers/cpufreq/mediatek-cpufreq-hw.c | 4 +- drivers/cpufreq/scmi-cpufreq.c | 4 +- drivers/opp/of.c | 6 +-- drivers/powercap/dtpm_cpu.c | 2 +- drivers/thermal/cpufreq_cooling.c | 2 +- drivers/thermal/devfreq_cooling.c | 8 ++-- include/linux/energy_model.h | 35 +++++++++++++-- kernel/power/energy_model.c | 63 +++++++++++++++------------ 9 files changed, 101 insertions(+), 47 deletions(-) -- 2.17.1