]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
PM: EM: Fix incorrect description of the cost field in struct em_perf_state
authorYaxiong Tian <tianyaxiong@kylinos.cn>
Tue, 30 Dec 2025 06:15:34 +0000 (14:15 +0800)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Thu, 8 Jan 2026 15:52:31 +0000 (16:52 +0100)
Due to commit 1b600da51073 ("PM: EM: Optimize em_cpu_energy() and remove
division"), the logic for energy consumption calculation has been modified.
The actual calculation of cost is 10 * power * max_frequency / frequency
instead of power * max_frequency / frequency.

Therefore, the comment for cost has been updated to reflect the correct
content.

Fixes: 1b600da51073 ("PM: EM: Optimize em_cpu_energy() and remove division")
Signed-off-by: Yaxiong Tian <tianyaxiong@kylinos.cn>
Reviewed-by: Lukasz Luba <lukasz.luba@arm.com>
[ rjw: Added Fixes: tag ]
Link: https://patch.msgid.link/20251230061534.816894-1-tianyaxiong@kylinos.cn
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
include/linux/energy_model.h

index 43aa6153dc5787f1904c905db4336e4f683674f1..e7497f8046442dabb5463914fd0be42a8ba1f4c2 100644 (file)
@@ -18,7 +18,7 @@
  * @power:     The power consumed at this level (by 1 CPU or by a registered
  *             device). It can be a total power: static and dynamic.
  * @cost:      The cost coefficient associated with this level, used during
- *             energy calculation. Equal to: power * max_frequency / frequency
+ *             energy calculation. Equal to: 10 * power * max_frequency / frequency
  * @flags:     see "em_perf_state flags" description below.
  */
 struct em_perf_state {