diff --git a/profiles/realtime-virtual-guest/tuned.conf b/profiles/realtime-virtual-guest/tuned.conf index b88cf33..1e49b2c 100644 --- a/profiles/realtime-virtual-guest/tuned.conf +++ b/profiles/realtime-virtual-guest/tuned.conf @@ -22,7 +22,7 @@ non_isolated_cores=${f:cpulist_invert:${isolated_cores}} assert2=${f:assertion:isolated_cores contains online CPU(s):${isolated_cores_expanded}:${isolated_cores_online_expanded}} [scheduler] -# group.group_name=rule_priority:scheduler_policy:scheduler_priority:core_affinity_in_hex:process_name_regex +# group.group_name=rule_priority:scheduler_policy:scheduler_priority:core_affinity_in_hex:process_name_regex[:thread_name_regex] # for i in `pgrep ksoftirqd` ; do grep Cpus_allowed_list /proc/$i/status ; done group.ksoftirqd=0:f:2:*:^\[ksoftirqd group.ktimers=0:f:2:*:^\[ktimers diff --git a/profiles/realtime-virtual-host/tuned.conf b/profiles/realtime-virtual-host/tuned.conf index 18ca6d4..81aed2e 100644 --- a/profiles/realtime-virtual-host/tuned.conf +++ b/profiles/realtime-virtual-host/tuned.conf @@ -26,7 +26,7 @@ non_isolated_cores=${f:cpulist_invert:${isolated_cores}} assert2=${f:assertion:isolated_cores contains online CPU(s):${isolated_cores_expanded}:${isolated_cores_online_expanded}} [scheduler] -# group.group_name=rule_priority:scheduler_policy:scheduler_priority:core_affinity_in_hex:process_name_regex +# group.group_name=rule_priority:scheduler_policy:scheduler_priority:core_affinity_in_hex:process_name_regex[:thread_name_regex] # for i in `pgrep ksoftirqd` ; do grep Cpus_allowed_list /proc/$i/status ; done group.ksoftirqd=0:f:2:*:^\[ksoftirqd group.ktimers=0:f:2:*:^\[ktimers diff --git a/tuned/plugins/plugin_scheduler.py b/tuned/plugins/plugin_scheduler.py index 72aeb87..8883c83 100644 --- a/tuned/plugins/plugin_scheduler.py +++ b/tuned/plugins/plugin_scheduler.py @@ -610,10 +610,11 @@ class SchedulerPlugin(base.Plugin): if not isinstance(process, procfs.process): pid = process process = procfs.process(pid) - cmdline = procfs.process_cmdline(process) + cmd = procfs.process_cmdline(process) + comm = process['stat']['comm'] if self._is_kthread(process): - cmdline = "[" + cmdline + "]" - return cmdline + return "[" + cmd + "]", "[" + comm + "]" + return cmd, comm # Raises OSError, IOError def get_processes(self): @@ -629,7 +630,7 @@ class SchedulerPlugin(base.Plugin): processes[pid] = cmd if "threads" in proc: for pid in proc["threads"].keys(): - cmd = self._get_cmdline(proc) + cmd = self._get_cmdline(pid) processes[pid] = cmd except (OSError, IOError) as e: if e.errno == errno.ENOENT \ @@ -870,7 +871,16 @@ class SchedulerPlugin(base.Plugin): (scheduler, priority) = self._convert_sched_params( scheduler, priority) affinity = self._convert_affinity(affinity) - return (rule_prio, scheduler, priority, affinity, regex) + # split regex into two, one to match the cmdline, and one the comm + # if there is only one regex for the cmdline, then the comm is matched by ".*" + # allow escaping of colons in regexes (-> '\:' is not a delimiter in the split) + regexes = re.split(r'(?