1
0
Fork 0

Use PF_KTHREAD to identify kernel threads

Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>
This commit is contained in:
Ondřej Lysoněk 2018-02-28 15:10:26 +01:00
parent 09d8ebf469
commit 4f5cb7e4fb

View file

@ -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)