1
0
Fork 0

Merge pull request #715 from ruihe774/raw_epp

plugin_cpu: allow raw energy_performance_preference values
This commit is contained in:
Jaroslav Škarvada 2025-01-16 22:08:18 +01:00 committed by GitHub
commit b8392f9932
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -807,7 +807,13 @@ class CPULatencyPlugin(hotplug.Plugin):
if not sim:
avail_vals = set(self._cmd.read_file(self._pstate_preference_path(cpu_id, True)).split())
for val in vals:
if val in avail_vals:
try:
val = int(val)
valid = 0 <= val < 256
val = str(val)
except ValueError:
valid = val in avail_vals
if valid:
self._cmd.write_to_file(self._pstate_preference_path(cpu_id), val, \
no_error = [errno.ENOENT] if remove else False, ignore_same=True)
log.info("Setting energy_performance_preference value '%s' for cpu '%s'" % (val, device))