Message ID | 20240208115557.1273962-10-lukasz.luba@arm.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-58002-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:50ea:b0:106:860b:bbdd with SMTP id r10csp111101dyd; Thu, 8 Feb 2024 04:00:06 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVx9WdWImy/Ob8xj4DpFUmEZ9ycFm2NPzddf81860I0ERr3zN7rEiL2rfAX/FkKHPE46UR1bjG+5Vs4RhBxUJBQcEnHXA== X-Google-Smtp-Source: AGHT+IF+oP9om4Ji6TKCHcO469kpdp4nGvhviuqS2gnD3O151G7b4+NvGed/DbYDuqhygoOo4mEP X-Received: by 2002:a05:6808:1289:b0:3bf:cc6a:d00 with SMTP id a9-20020a056808128900b003bfcc6a0d00mr11045668oiw.8.1707393605679; Thu, 08 Feb 2024 04:00:05 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707393605; cv=pass; d=google.com; s=arc-20160816; b=jq3toOciojP/OTaoR1zE4z9y3NQA98cSCyLAWwfx5ENpYzdXcgYmWToUH4EqSxPMip AF/wAE7Ud1cn1Dj9gqlFLwA9xk4ySzbg6JoGRsr9zT0hKE982kABTj9Fixt94mOUBtph kaMrzLNora78qPxud2lLn+ZkHo8KoD+uzL5rwpTebf2MQ7bt8slJ5Hn85MBrgkgCjewO OtKhn1MEz+F/xHFQcK78Vlokzpuhz/ys0Sr1o4N5D/QfmblLwtPaLSBV+SKPEVHq4K+J wg0r61Q9GzvPFkQG3vObaCNYLzh3UlCcY9eg+4STRGGbEt+1SaYm2cP4+5lbH7BIvVEP SUnw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=BBCshDgzvyYzGZn9xmC/6TISc2fmUCjGJYfyXQLT3Mw=; fh=Vth8BRR97Xrto30raIrfS43QQoi/yAu3QIXJGlyycCI=; b=KQVfMCVgpGZUYdG53ZV5D7iZ8yTIfD1672eglMrIzTFnKqo43ey+nGI5xyVcfEWoyg 4ZndRosVbgbxhPNbCQYQYnRhSh1FTVEojU027ERBP2RdoNT8N4tRMDvK6Byp21dFoKVo 6urjb1h6r+2rDy05pbiuoo0Gem6WkUsktMKNTMukUFGLXFRupWCVZVVrrNKQRVwqdhQ6 9gUbCxZXVimQkcscz5U4R7aYRpSJe3VUuWKzEbak8occ5THjphzCI+FCxIHysAsZqfI0 B6rN4p2miL1+4UWYO2f2BXS4pgUw/ZCybnsQrXxUgO6640Q4G+RHRKFJCyQ/r+omaoLY vwMQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-58002-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-58002-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com X-Forwarded-Encrypted: i=2; AJvYcCVHSm2OsBwpjUqWkzL9zAwISKv2wIy/Q4vbvqMjAz2W+Sb9fKDSOSNlS3UH+yX54dm8+zjBytKuKBWLtkR8Za8a9QIN7A== Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id r7-20020aa78447000000b006e03ac13dbcsi3629481pfn.31.2024.02.08.04.00.05 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Feb 2024 04:00:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-58002-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-58002-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-58002-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id EB441282536 for <ouuuleilei@gmail.com>; Thu, 8 Feb 2024 11:59:03 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A720079920; Thu, 8 Feb 2024 11:56:36 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 502D276C8C; Thu, 8 Feb 2024 11:56:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707393395; cv=none; b=EHPF3sn6H6Tm5Oj+djv0oSMzvK3o5G/YbsRd8xIQgRracFad4RShO/PwpoW0h8q0dbW8xtqx70716cl9ztLaha07auqhbdiaFvPyqTHzaCiq3E2xLq4iJaTAx2Ye3WVAFw2/g+DeZrm8adeymspOMOZ5XLxTOj/FfDZsZ+xVkBI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707393395; c=relaxed/simple; bh=jSDNw/gdJcgEyLMwynWhjBDaJb3Vfg+ndN6jLvTWrnk=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=jsDiU52HOnBD2TH1ARYvj99ykGkU3sxuCKb3mdeZZjdW9DAe+lLnUFcObwUNvL0tj/REtwVfPsK9SL9rzaN/khhr6fimeGgxYcmkEdYdWL11FPoPAiqI62WZOea23at/scH5J3ANugeJ04znIWqHL4p+Bw56+Gmt5t8CvRFad3o= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com 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 06C7B1FB; Thu, 8 Feb 2024 03:57:15 -0800 (PST) Received: from e129166.arm.com (unknown [10.57.8.23]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 274A53F5A1; Thu, 8 Feb 2024 03:56:30 -0800 (PST) From: Lukasz Luba <lukasz.luba@arm.com> 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, xuewen.yan94@gmail.com Subject: [PATCH v8 09/23] PM: EM: Use runtime modified EM for CPUs energy estimation in EAS Date: Thu, 8 Feb 2024 11:55:43 +0000 Message-Id: <20240208115557.1273962-10-lukasz.luba@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240208115557.1273962-1-lukasz.luba@arm.com> References: <20240208115557.1273962-1-lukasz.luba@arm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790331957455185565 X-GMAIL-MSGID: 1790331957455185565 |
Series |
Introduce runtime modifiable Energy Model
|
|
Commit Message
Lukasz Luba
Feb. 8, 2024, 11:55 a.m. UTC
The new Energy Model (EM) supports runtime modification of the performance state table to better model the power used by the SoC. Use this new feature to improve energy estimation and therefore task placement in Energy Aware Scheduler (EAS). Reviewed-by: Dietmar Eggemann <dietmar.eggemann@arm.com> Tested-by: Dietmar Eggemann <dietmar.eggemann@arm.com> Signed-off-by: Lukasz Luba <lukasz.luba@arm.com> --- include/linux/energy_model.h | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/include/linux/energy_model.h b/include/linux/energy_model.h index 8ddf1d8a9581..5f842da3bb0c 100644 --- a/include/linux/energy_model.h +++ b/include/linux/energy_model.h @@ -239,9 +239,14 @@ static inline unsigned long em_cpu_energy(struct em_perf_domain *pd, unsigned long allowed_cpu_cap) { unsigned long freq, ref_freq, scale_cpu; + struct em_perf_table *em_table; struct em_perf_state *ps; int cpu, i; +#ifdef CONFIG_SCHED_DEBUG + WARN_ONCE(!rcu_read_lock_held(), "EM: rcu read lock needed\n"); +#endif + if (!sum_util) return 0; @@ -264,9 +269,10 @@ static inline unsigned long em_cpu_energy(struct em_perf_domain *pd, * Find the lowest performance state of the Energy Model above the * requested frequency. */ - i = em_pd_get_efficient_state(pd->table, pd->nr_perf_states, freq, - pd->flags); - ps = &pd->table[i]; + em_table = rcu_dereference(pd->em_table); + i = em_pd_get_efficient_state(em_table->state, pd->nr_perf_states, + freq, pd->flags); + ps = &em_table->state[i]; /* * The capacity of a CPU in the domain at the performance state (ps)