lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20201002122416.13659-3-lukasz.luba@arm.com>
Date:   Fri,  2 Oct 2020 13:24:16 +0100
From:   Lukasz Luba <lukasz.luba@....com>
To:     linux-kernel@...r.kernel.org, linux-pm@...r.kernel.org
Cc:     daniel.lezcano@...aro.org, amitk@...nel.org,
        Dietmar.Eggemann@....com, lukasz.luba@....com
Subject: [PATCH 2/2] thermal: power allocator: estimate sustainable power only once

The sustainable power value might come from the Device Tree or can be
estimated in run time. There is no need to estimate every time when the
governor is called and temperature is high. Instead, store the estimated
value and make it available via standard sysfs interface so it can be
checked from the user-space.

Signed-off-by: Lukasz Luba <lukasz.luba@....com>
---
 drivers/thermal/gov_power_allocator.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/thermal/gov_power_allocator.c b/drivers/thermal/gov_power_allocator.c
index f69fafe486a5..dd59085f38f5 100644
--- a/drivers/thermal/gov_power_allocator.c
+++ b/drivers/thermal/gov_power_allocator.c
@@ -204,6 +204,8 @@ static u32 pid_controller(struct thermal_zone_device *tz,
 		estimate_pid_constants(tz, sustainable_power,
 				       params->trip_switch_on, control_temp,
 				       true);
+		/* Do the estimation only once and make available in sysfs */
+		tz->tzp->sustainable_power = sustainable_power;
 	}
 
 	err = control_temp - tz->temperature;
-- 
2.17.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ