From a897259eec4cdc925f0bcb44fa391ebfdc6f4f16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Lyson=C4=9Bk?= Date: Mon, 21 May 2018 11:59:30 +0200 Subject: [PATCH] scheduler: Drop no_error argument in _set_affinity() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit I believe it was originally added so that errors are not logged when we fail to set the affinity of a short-lived process which has already disappeared. This is no longer necessary, because we always check if the process has disappeared, and log debug messages instead of errors if it has. Signed-off-by: Ondřej Lysoněk --- tuned/plugins/plugin_scheduler.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tuned/plugins/plugin_scheduler.py b/tuned/plugins/plugin_scheduler.py index f3e26b0..7e78851 100644 --- a/tuned/plugins/plugin_scheduler.py +++ b/tuned/plugins/plugin_scheduler.py @@ -214,12 +214,12 @@ class SchedulerPlugin(base.Plugin): log.error("Failed to get task info for PID %s: %s" % (pid, str(e))) return -2 - def _set_affinity(self, pid, affinity, no_error = False): + def _set_affinity(self, pid, affinity): if pid is None or affinity is None: return log.debug("setting affinity to '%s' for PID '%s'" % (affinity, pid)) - (ret, out, err_msg) = self._cmd.execute(["taskset", "-p", str(affinity), str(pid)], no_errors = [1] if no_error else [], return_err = True) - if ret == 0 or (ret == 1 and no_error): + (ret, out, err_msg) = self._cmd.execute(["taskset", "-p", str(affinity), str(pid)], no_errors = [], return_err = True) + if ret == 0: return res = self._affinity_changeable(pid) if res == 1 or res == -2: @@ -234,7 +234,7 @@ class SchedulerPlugin(base.Plugin): self._scheduler_original[pid] = (cmd, rt[0], rt[1], prev_affinity) self._set_rt(pid, self._schedcfg2param(sched), prio, no_error) if affinity != "*": - self._set_affinity(pid, affinity, no_error) + self._set_affinity(pid, affinity) def _instance_apply_static(self, instance): super(SchedulerPlugin, self)._instance_apply_static(instance)