1
0
Fork 0

Merge pull request #850 from yarda/boost_fix

cpu: do not log error if boost isn't supported
This commit is contained in:
Jaroslav Škarvada 2026-05-14 18:33:23 +02:00 committed by GitHub
commit 0eb28ac3d8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -775,13 +775,18 @@ class CPULatencyPlugin(hotplug.Plugin):
cpu_id = device.lstrip("cpu")
boost_set = False
boost = self._cmd.get_bool(boost)
if os.path.exists(self._pstate_boost_path(cpu_id)):
if not sim:
if boost == "0" or boost == "1":
self._cmd.write_to_file(self._pstate_boost_path(cpu_id), boost, \
no_error = [errno.ENOENT] if remove else False, ignore_same=True)
log.info("Setting boost value '%s' for cpu '%s'" % (boost, device))
boost_set = True
# EINVAL if boost isn't supported
_no_error = [errno.EINVAL]
if remove:
_no_error = _no_error + [errno.ENOENT]
if self._cmd.write_to_file(self._pstate_boost_path(cpu_id), boost, \
no_error = _no_error, ignore_same=True):
boost_set = True
else:
log.error("Failed to set boost on cpu '%s'. Is the value in the profile correct?" % device)
else:
@ -814,7 +819,10 @@ class CPULatencyPlugin(hotplug.Plugin):
return None
cpu_id = device.lstrip("cpu")
if os.path.exists(self._pstate_boost_path(cpu_id)):
return self._cmd.read_file(self._pstate_boost_path(cpu_id)).strip()
val = self._cmd.read_file(self._pstate_boost_path(cpu_id)).strip()
# write returns EINVAL if boost isn't supported
return val if self._cmd.write_to_file(self._pstate_boost_path(cpu_id), val, \
no_error = True) else None
else:
log.debug("boost file missing, which can happen on pre 6.11 kernels.")
return None