From 4f5cb7e4fb10202ed297c71f5eaeb0c2dcfa2cc1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Lyson=C4=9Bk?= Date: Wed, 28 Feb 2018 15:10:26 +0100 Subject: [PATCH] Use PF_KTHREAD to identify kernel threads MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Ondřej Lysoněk --- tuned/plugins/plugin_scheduler.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tuned/plugins/plugin_scheduler.py b/tuned/plugins/plugin_scheduler.py index 43a35f6..0af5dbb 100644 --- a/tuned/plugins/plugin_scheduler.py +++ b/tuned/plugins/plugin_scheduler.py @@ -199,7 +199,7 @@ class SchedulerPlugin(base.Plugin): if process["stat"].is_bound_to_cpu(): if process["stat"]["state"] == "Z": log.debug("Affinity of zombie task with PID %s cannot be changed, the task's affinity mask is fixed." % pid) - elif len(process["cmdline"]) == 0: + elif process["stat"]["flags"] & procfs.pidstat.PF_KTHREAD != 0: log.debug("Affinity of kernel thread with PID %s cannot be changed, the task's affinity mask is fixed." % pid) else: log.warn("Affinity of task with PID %s cannot be changed, the task's affinity mask is fixed." % pid)