From e054d86e119cc54bf84f012e30010d843b30675a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaroslav=20=C5=A0karvada?= Date: Tue, 21 Apr 2026 19:45:21 +0200 Subject: [PATCH] cpu: do not log error if boost isn't supported MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Resolves: RHEL-169618 Signed-off-by: Jaroslav Škarvada --- tuned/plugins/plugin_cpu.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/tuned/plugins/plugin_cpu.py b/tuned/plugins/plugin_cpu.py index 222824b..e4a88a9 100644 --- a/tuned/plugins/plugin_cpu.py +++ b/tuned/plugins/plugin_cpu.py @@ -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