diff --git a/tuned/plugins/plugin_scheduler.py b/tuned/plugins/plugin_scheduler.py index c9ac01b8..8cfb1fd5 100644 --- a/tuned/plugins/plugin_scheduler.py +++ b/tuned/plugins/plugin_scheduler.py @@ -446,6 +446,7 @@ def __init__(self, monitor_repository, storage_factory, hardware_inventory, devi # default is to whitelist all and blacklist none self._ps_whitelist = ".*" self._ps_blacklist = "" + self._kthread_process = True self._cgroup_ps_blacklist_re = "" self._cpus = perf.cpu_map() self._scheduler_storage_key = self._storage_key( @@ -550,6 +551,7 @@ def _get_config_options(cls): "cgroup_ps_blacklist": None, "ps_whitelist": None, "ps_blacklist": None, + "kthread_process": True, "irq_process": True, "default_irq_smp_affinity": "calc", "perf_mmap_pages": None, @@ -586,6 +588,8 @@ def get_processes(self): processes = {} for proc in ps.values(): try: + if not self._kthread_process and self._is_kthread(proc): + continue cmd = self._get_cmdline(proc) pid = proc["pid"] processes[pid] = cmd @@ -1059,6 +1063,9 @@ def _instance_verify_static(self, instance, ignore_missing, devices): def _add_pid(self, instance, pid, r): try: + proc = procfs.process(pid) + if not self._kthread_process and self._is_kthread(proc): + return cmd = self._get_cmdline(pid) except (OSError, IOError) as e: if e.errno == errno.ENOENT \ @@ -1134,6 +1141,14 @@ def _ps_blacklist(self, enabling, value, verify, ignore_missing): if enabling and value is not None: self._ps_blacklist = "|".join(["(%s)" % v for v in re.split(r"(?