From bfc670dffc98eaa905f6d154ab6333b499af2cb1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Lyson=C4=9Bk?= Date: Tue, 22 May 2018 21:36:22 +0200 Subject: [PATCH] scheduler: Don't tune a process if reading original parameters failed MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We should not touch a process if we cannot later revert to it's original state. Signed-off-by: Ondřej Lysoněk --- tuned/plugins/plugin_scheduler.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tuned/plugins/plugin_scheduler.py b/tuned/plugins/plugin_scheduler.py index 9ff7d7a..7c90592 100644 --- a/tuned/plugins/plugin_scheduler.py +++ b/tuned/plugins/plugin_scheduler.py @@ -246,6 +246,11 @@ class SchedulerPlugin(base.Plugin): scheduler = rt[0], priority = rt[1], affinity = prev_affinity) + else: + if self._pid_exists(pid): + log.error("Refusing to tune PID %d, reading original scheduling parameters failed." + % pid) + return self._set_rt(pid, self._schedcfg2param(sched), prio) if affinity != "*": self._set_affinity(pid, affinity)