From f733e6e666036c68f5e228e029f3fce3ed38bad8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Lyson=C4=9Bk?= Date: Mon, 2 Jul 2018 23:14:11 +0200 Subject: [PATCH 1/9] scheduler: isolated_cores: Fix checking CPUs are valid MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix checking that the list of CPUs specified in isolated_cores contains only CPUs that are present on the machine. Signed-off-by: Ondřej Lysoněk --- tuned/plugins/plugin_scheduler.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tuned/plugins/plugin_scheduler.py b/tuned/plugins/plugin_scheduler.py index 3949cb2..bd2e1ae 100644 --- a/tuned/plugins/plugin_scheduler.py +++ b/tuned/plugins/plugin_scheduler.py @@ -612,12 +612,13 @@ class SchedulerPlugin(base.Plugin): return None if enabling: if value is not None: - affinity = self._cmd.cpulist_invert(value) - sa = set(affinity) - if set(self._cpus).intersection(sa) != sa: + isolated = set(self._cmd.cpulist_unpack(value)) + present = set(self._cpus) + if not isolated.issubset(present): str_cpus = ",".join([str(x) for x in self._cpus]) log.error("invalid isolated_cores specified, '%s' don't match available cores '%s'" % (value, str_cpus)) return None + affinity = list(present - isolated) self._set_ps_affinity(affinity) self._set_all_irq_affinity(affinity) else: From c170b69602ad865b9fb01241b4ebf8dbe32297fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Lyson=C4=9Bk?= Date: Mon, 2 Jul 2018 23:14:34 +0200 Subject: [PATCH 2/9] realtime-virtual-host: Fix verification in script.sh MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The code was completely broken. Jaroslav and I think the purpose of the code was to check that the files /sys/module/kvm/parameters/kvmclock_periodic_sync /sys/module/kvm_intel/parameters/ple_gap contain "0", which we think is the (at least intended) result of profiles/functions:setup_kvm_mod_low_latency(). So I'm fixing it to do that. Signed-off-by: Ondřej Lysoněk --- profiles/realtime-virtual-host/script.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/profiles/realtime-virtual-host/script.sh b/profiles/realtime-virtual-host/script.sh index e821bef..22bc1bc 100755 --- a/profiles/realtime-virtual-host/script.sh +++ b/profiles/realtime-virtual-host/script.sh @@ -104,12 +104,14 @@ stop() { verify() { python /usr/libexec/tuned/defirqaffinity.py "verify" "$TUNED_isolated_cores_expanded" - retval = "$?" + retval=$? if [ $retval -eq 0 -a -f /sys/module/kvm/parameters/kvmclock_periodic_sync ]; then - retval = `cat /sys/module/kvm/parameters/kvmclock_periodic_sync` + test "$(cat /sys/module/kvm/parameters/kvmclock_periodic_sync)" = 0 + retval=$? fi if [ $retval -eq 0 -a -f /sys/module/kvm_intel/parameters/ple_gap ]; then - retval = `cat /sys/module/kvm_intel/parameters/ple_gap` + test "$(cat /sys/module/kvm_intel/parameters/ple_gap)" = 0 + retval=$? fi return $retval } From 98254efae03ba2b5818d5ab4569a00f5d796b6a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Lyson=C4=9Bk?= Date: Mon, 2 Jul 2018 23:14:41 +0200 Subject: [PATCH 3/9] scheduler: Refactor 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 | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/tuned/plugins/plugin_scheduler.py b/tuned/plugins/plugin_scheduler.py index bd2e1ae..4ccd059 100644 --- a/tuned/plugins/plugin_scheduler.py +++ b/tuned/plugins/plugin_scheduler.py @@ -607,20 +607,24 @@ class SchedulerPlugin(base.Plugin): @command_custom("isolated_cores", per_device = False, priority = 10) def _isolated_cores(self, enabling, value, verify, ignore_missing): + affinity = None + if value is not None: + isolated = set(self._cmd.cpulist_unpack(value)) + present = set(self._cpus) + if isolated.issubset(present): + affinity = list(present - isolated) + else: + str_cpus = ",".join([str(x) for x in self._cpus]) + log.error("Invalid isolated_cores specified, '%s' does not match available cores '%s'" + % (value, str_cpus)) + if (enabling or verify) and affinity is None: + return None # currently unsupported if verify: return None - if enabling: - if value is not None: - isolated = set(self._cmd.cpulist_unpack(value)) - present = set(self._cpus) - if not isolated.issubset(present): - str_cpus = ",".join([str(x) for x in self._cpus]) - log.error("invalid isolated_cores specified, '%s' don't match available cores '%s'" % (value, str_cpus)) - return None - affinity = list(present - isolated) - self._set_ps_affinity(affinity) - self._set_all_irq_affinity(affinity) + elif enabling: + self._set_ps_affinity(affinity) + self._set_all_irq_affinity(affinity) else: # Restoring processes' affinity is done in # _instance_unapply_static() From 97553260b2834e1a65b13baa1b83086f0ebb8cd2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Lyson=C4=9Bk?= Date: Mon, 2 Jul 2018 23:14:43 +0200 Subject: [PATCH 4/9] scheduler: Set IRQ affinity only if current affinity is different MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Resolves: rhbz#1590937 Signed-off-by: Ondřej Lysoněk --- tuned/plugins/plugin_scheduler.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tuned/plugins/plugin_scheduler.py b/tuned/plugins/plugin_scheduler.py index 4ccd059..53a74d0 100644 --- a/tuned/plugins/plugin_scheduler.py +++ b/tuned/plugins/plugin_scheduler.py @@ -580,9 +580,10 @@ class SchedulerPlugin(base.Plugin): except KeyError: continue _affinity = self._get_intersect_affinity(prev_affinity, affinity, affinity) - affinity_hex = self._cmd.cpulist2hex(_affinity) - self._set_irq_affinity(irq, affinity_hex) - irq_original.irqs[irq] = prev_affinity + if set(_affinity) != set(prev_affinity): + affinity_hex = self._cmd.cpulist2hex(_affinity) + self._set_irq_affinity(irq, affinity_hex) + irq_original.irqs[irq] = prev_affinity # default affinity prev_affinity_hex = self._cmd.read_file("/proc/irq/default_smp_affinity") From 3534d7dabc48e39969d9c57a406fa96d447a9b93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Lyson=C4=9Bk?= Date: Mon, 2 Jul 2018 23:14:45 +0200 Subject: [PATCH 5/9] scheduler: Restore IRQ affinity only if setting it succeeded MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Resolves: rhbz#1590937 Signed-off-by: Ondřej Lysoněk --- tuned/plugins/plugin_scheduler.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tuned/plugins/plugin_scheduler.py b/tuned/plugins/plugin_scheduler.py index 53a74d0..2be8e56 100644 --- a/tuned/plugins/plugin_scheduler.py +++ b/tuned/plugins/plugin_scheduler.py @@ -580,9 +580,10 @@ class SchedulerPlugin(base.Plugin): except KeyError: continue _affinity = self._get_intersect_affinity(prev_affinity, affinity, affinity) - if set(_affinity) != set(prev_affinity): - affinity_hex = self._cmd.cpulist2hex(_affinity) - self._set_irq_affinity(irq, affinity_hex) + if set(_affinity) == set(prev_affinity): + continue + affinity_hex = self._cmd.cpulist2hex(_affinity) + if self._set_irq_affinity(irq, affinity_hex): irq_original.irqs[irq] = prev_affinity # default affinity From 0aa7d1300f4f3768bfbb4146b4b7a1214ea524fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Lyson=C4=9Bk?= Date: Mon, 2 Jul 2018 23:14:48 +0200 Subject: [PATCH 6/9] scheduler: Improve logging when setting IRQ affinity MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The EIO errno is returned by kernel/irq/proc.c:write_irq_affinity() if and only if changing SMP affinity of a particular IRQ is not supported (at least on Linux 3.10 and 4.18). So let's log a failure to change the affinity only as DEBUG if we get EIO and we are not in the process of restoring the affinity, because the failure is expected and there's nothing we can do about it. If we're restoring, use ERROR log level, so that the user is informed that we failed to restore the affinity to its original state (this should not happen though). Other errnos can be significant, so always log them as ERROR. Resolves: rhbz#1590937 Signed-off-by: Ondřej Lysoněk --- tuned/plugins/plugin_scheduler.py | 50 ++++++++++++++++++++++--------- 1 file changed, 36 insertions(+), 14 deletions(-) diff --git a/tuned/plugins/plugin_scheduler.py b/tuned/plugins/plugin_scheduler.py index 2be8e56..bcd5bb7 100644 --- a/tuned/plugins/plugin_scheduler.py +++ b/tuned/plugins/plugin_scheduler.py @@ -561,13 +561,39 @@ class SchedulerPlugin(base.Plugin): log.error("error applying tuning, cannot get information about running processes: %s" % e) - def _set_irq_affinity(self, irq, affinity_hex): - self._cmd.write_to_file("/proc/irq/%s/smp_affinity" % irq, - affinity_hex, no_error = True) + def _set_irq_affinity(self, irq, affinity, restoring): + try: + affinity_hex = self._cmd.cpulist2hex(affinity) + log.debug("Setting SMP affinity of IRQ %s to '%s'" + % (irq, affinity_hex)) + filename = "/proc/irq/%s/smp_affinity" % irq + with open(filename, "w") as f: + f.write(affinity_hex) + return True + except (OSError, IOError) as e: + # EIO is returned by + # kernel/irq/proc.c:write_irq_affinity() if changing + # the affinity is not supported + # (at least on kernels 3.10 and 4.18) + if hasattr(e, "errno") and e.errno == errno.EIO \ + and not restoring: + log.debug("Setting SMP affinity of IRQ %s is not supported" + % irq) + else: + log.error("Failed to set SMP affinity of IRQ %s to '%s': %s" + % (irq, affinity_hex, e)) + return False - def _set_default_irq_affinity(self, affinity_hex): - self._cmd.write_to_file("/proc/irq/default_smp_affinity", - affinity_hex) + def _set_default_irq_affinity(self, affinity): + try: + affinity_hex = self._cmd.cpulist2hex(affinity) + log.debug("Setting default SMP IRQ affinity to '%s'" + % affinity_hex) + with open("/proc/irq/default_smp_affinity", "w") as f: + f.write(affinity_hex) + except (OSError, IOError) as e: + log.error("Failed to set default SMP IRQ affinity to '%s': %s" + % (affinity_hex, e)) def _set_all_irq_affinity(self, affinity): irq_original = IRQAffinities() @@ -582,16 +608,14 @@ class SchedulerPlugin(base.Plugin): _affinity = self._get_intersect_affinity(prev_affinity, affinity, affinity) if set(_affinity) == set(prev_affinity): continue - affinity_hex = self._cmd.cpulist2hex(_affinity) - if self._set_irq_affinity(irq, affinity_hex): + if self._set_irq_affinity(irq, _affinity, False): irq_original.irqs[irq] = prev_affinity # default affinity prev_affinity_hex = self._cmd.read_file("/proc/irq/default_smp_affinity") prev_affinity = self._cmd.hex2cpulist(prev_affinity_hex) _affinity = self._get_intersect_affinity(prev_affinity, affinity, affinity) - affinity_hex = self._cmd.cpulist2hex(_affinity) - self._set_default_irq_affinity(affinity_hex) + self._set_default_irq_affinity(_affinity) irq_original.default = prev_affinity self._storage.set(self._irq_storage_key, irq_original) @@ -600,11 +624,9 @@ class SchedulerPlugin(base.Plugin): if irq_original is None: return for irq, affinity in irq_original.irqs.items(): - affinity_hex = self._cmd.cpulist2hex(affinity) - self._set_irq_affinity(irq, affinity_hex) + self._set_irq_affinity(irq, affinity, True) affinity = irq_original.default - affinity_hex = self._cmd.cpulist2hex(affinity) - self._set_default_irq_affinity(affinity_hex) + self._set_default_irq_affinity(affinity) self._storage.unset(self._irq_storage_key) @command_custom("isolated_cores", per_device = False, priority = 10) From aa712fe58467218963330402ac47d846acf34825 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Lyson=C4=9Bk?= Date: Mon, 2 Jul 2018 23:14:50 +0200 Subject: [PATCH 7/9] scheduler: Add support for IRQ affinity verification 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 | 41 +++++++++++++++++++++++++++++-- 1 file changed, 39 insertions(+), 2 deletions(-) diff --git a/tuned/plugins/plugin_scheduler.py b/tuned/plugins/plugin_scheduler.py index bcd5bb7..93b6d91 100644 --- a/tuned/plugins/plugin_scheduler.py +++ b/tuned/plugins/plugin_scheduler.py @@ -629,6 +629,43 @@ class SchedulerPlugin(base.Plugin): self._set_default_irq_affinity(affinity) self._storage.unset(self._irq_storage_key) + def _verify_irq_affinity(self, irq_description, correct_affinity, + current_affinity): + res = set(current_affinity).issubset(set(correct_affinity)) + if res: + log.info(consts.STR_VERIFY_PROFILE_VALUE_OK + % (irq_description, current_affinity)) + else: + log.error(consts.STR_VERIFY_PROFILE_VALUE_FAIL + % (irq_description, current_affinity, + correct_affinity)) + return res + + def _verify_all_irq_affinity(self, correct_affinity): + irqs = procfs.interrupts() + res = True + for irq in irqs.keys(): + try: + current_affinity = irqs[irq]["affinity"] + log.debug("Read SMP affinity of IRQ '%s': '%s'" + % (irq, current_affinity)) + irq_description = "SMP affinity of IRQ %s" % irq + if not self._verify_irq_affinity( + irq_description, + correct_affinity, + current_affinity): + res = False + except KeyError: + continue + + current_affinity_hex = self._cmd.read_file( + "/proc/irq/default_smp_affinity") + current_affinity = self._cmd.hex2cpulist(current_affinity_hex) + if not self._verify_irq_affinity("default IRQ SMP affinity", + current_affinity, correct_affinity): + res = False + return res + @command_custom("isolated_cores", per_device = False, priority = 10) def _isolated_cores(self, enabling, value, verify, ignore_missing): affinity = None @@ -643,9 +680,9 @@ class SchedulerPlugin(base.Plugin): % (value, str_cpus)) if (enabling or verify) and affinity is None: return None - # currently unsupported + # currently only IRQ affinity verification is supported if verify: - return None + return self._verify_all_irq_affinity(affinity) elif enabling: self._set_ps_affinity(affinity) self._set_all_irq_affinity(affinity) From 66b247a7e9119796a40a159b7f7e4d70d529ad63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Lyson=C4=9Bk?= Date: Mon, 2 Jul 2018 23:14:52 +0200 Subject: [PATCH 8/9] cpu-partitioning: Modify irqbalance config regardless of defirqaffinity exit code MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Previously the irqbalance config was not modified if setting the affinity of at least one IRQ failed. That does not make much sense to me - it can result in irqbalance assigning isolated CPUs to IRQs, even if it can be prevented. Even if affinity cannot be changed for any of the present IRQs, hypothetically it can happen (I think) that new hardware is hotplugged, and the affinity of its IRQ can be changed. So let's always modify the irqbalance config for good measure. Signed-off-by: Ondřej Lysoněk --- profiles/cpu-partitioning/script.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/profiles/cpu-partitioning/script.sh b/profiles/cpu-partitioning/script.sh index fe725ca..6d29fe7 100755 --- a/profiles/cpu-partitioning/script.sh +++ b/profiles/cpu-partitioning/script.sh @@ -39,10 +39,9 @@ start() { mkdir -p "${TUNED_tmpdir}/usr/lib/dracut/hooks/pre-udev" cp /etc/systemd/system.conf "${TUNED_tmpdir}/etc/systemd/" cp 00-tuned-pre-udev.sh "${TUNED_tmpdir}/usr/lib/dracut/hooks/pre-udev/" - if python /usr/libexec/tuned/defirqaffinity.py "remove" "$TUNED_isolated_cores_expanded"; then - sed -i '/^IRQBALANCE_BANNED_CPUS=/d' /etc/sysconfig/irqbalance - echo "IRQBALANCE_BANNED_CPUS=$TUNED_isolated_cpumask" >>/etc/sysconfig/irqbalance - fi + python /usr/libexec/tuned/defirqaffinity.py "remove" "$TUNED_isolated_cores_expanded" + sed -i '/^IRQBALANCE_BANNED_CPUS=/d' /etc/sysconfig/irqbalance + echo "IRQBALANCE_BANNED_CPUS=$TUNED_isolated_cpumask" >>/etc/sysconfig/irqbalance setup_kvm_mod_low_latency disable_ksm From c2dfc1f80695f0cdd6782a6d72787b378128fc47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Lyson=C4=9Bk?= Date: Mon, 2 Jul 2018 23:14:54 +0200 Subject: [PATCH 9/9] profiles: Replace calls to defirqaffinity.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In the cpu-partitioning profile, IRQ affinity change is already done as part of the 'isolated_cores' option of the scheduler plugin, so calling defirqaffinity is, at best, redundant. So let's remove the call. In the realtime* profiles, it's essentially the same, except that tuna was used instead of isolated_cores. So let's use built-in functionality instead of tuna and drop calls to defirqaffinity. Resolves: rhbz#1590937 Signed-off-by: Ondřej Lysoněk --- profiles/cpu-partitioning/script.sh | 7 ------- profiles/realtime-virtual-guest/script.sh | 20 -------------------- profiles/realtime-virtual-guest/tuned.conf | 3 +-- profiles/realtime-virtual-host/script.sh | 9 +-------- profiles/realtime-virtual-host/tuned.conf | 2 ++ profiles/realtime/script.sh | 10 +--------- profiles/realtime/tuned.conf | 3 +++ 7 files changed, 8 insertions(+), 46 deletions(-) delete mode 100755 profiles/realtime-virtual-guest/script.sh diff --git a/profiles/cpu-partitioning/script.sh b/profiles/cpu-partitioning/script.sh index 6d29fe7..0e94d3a 100755 --- a/profiles/cpu-partitioning/script.sh +++ b/profiles/cpu-partitioning/script.sh @@ -39,7 +39,6 @@ start() { mkdir -p "${TUNED_tmpdir}/usr/lib/dracut/hooks/pre-udev" cp /etc/systemd/system.conf "${TUNED_tmpdir}/etc/systemd/" cp 00-tuned-pre-udev.sh "${TUNED_tmpdir}/usr/lib/dracut/hooks/pre-udev/" - python /usr/libexec/tuned/defirqaffinity.py "remove" "$TUNED_isolated_cores_expanded" sed -i '/^IRQBALANCE_BANNED_CPUS=/d' /etc/sysconfig/irqbalance echo "IRQBALANCE_BANNED_CPUS=$TUNED_isolated_cpumask" >>/etc/sysconfig/irqbalance setup_kvm_mod_low_latency @@ -51,7 +50,6 @@ start() { } stop() { - python /usr/libexec/tuned/defirqaffinity.py "add" "$TUNED_isolated_cores_expanded" if [ "$1" = "full_rollback" ] then sed -i '/^IRQBALANCE_BANNED_CPUS=/d' /etc/sysconfig/irqbalance @@ -62,9 +60,4 @@ stop() { return "$?" } -verify() { - python /usr/libexec/tuned/defirqaffinity.py "verify" "$TUNED_isolated_cores_expanded" - return "$?" -} - process $@ diff --git a/profiles/realtime-virtual-guest/script.sh b/profiles/realtime-virtual-guest/script.sh deleted file mode 100755 index f3d7443..0000000 --- a/profiles/realtime-virtual-guest/script.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/sh - -. /usr/lib/tuned/functions - -start() { - python /usr/libexec/tuned/defirqaffinity.py "remove" "$TUNED_isolated_cores_expanded" && - return "$?" -} - -stop() { - python /usr/libexec/tuned/defirqaffinity.py "add" "$TUNED_isolated_cores_expanded" - return "$?" -} - -verify() { - python /usr/libexec/tuned/defirqaffinity.py "verify" "$TUNED_isolated_cores_expanded" - return "$?" -} - -process $@ diff --git a/profiles/realtime-virtual-guest/tuned.conf b/profiles/realtime-virtual-guest/tuned.conf index cf349ef..b90e76f 100644 --- a/profiles/realtime-virtual-guest/tuned.conf +++ b/profiles/realtime-virtual-guest/tuned.conf @@ -34,8 +34,7 @@ group.rcub=0:f:4:*:rcub.* # for i in `pgrep ktimersoftd` ; do grep Cpus_allowed_list /proc/$i/status ; done group.ktimersoftd=0:f:3:*:ktimersoftd.* -[script] -script=${i:PROFILE_DIR}/script.sh +ps_blacklist=ksoftirqd.*;rcuc.*;rcub.*;ktimersoftd.* [bootloader] cmdline_rvg=+nohz=on nohz_full=${isolated_cores} rcu_nocbs=${isolated_cores} diff --git a/profiles/realtime-virtual-host/script.sh b/profiles/realtime-virtual-host/script.sh index 22bc1bc..515d254 100755 --- a/profiles/realtime-virtual-host/script.sh +++ b/profiles/realtime-virtual-host/script.sh @@ -44,10 +44,6 @@ run_tsc_deadline_latency() } start() { - if ! /usr/libexec/tuned/defirqaffinity.py "remove" "$TUNED_isolated_cores_expanded"; then - die defirqaffinity.py remove failed - fi - setup_kvm_mod_low_latency disable_ksm @@ -97,15 +93,12 @@ start() { stop() { [ "$1" = "full_rollback" ] && teardown_kvm_mod_low_latency - python /usr/libexec/tuned/defirqaffinity.py "add" "$TUNED_isolated_cores_expanded" enable_ksm return "$?" } verify() { - python /usr/libexec/tuned/defirqaffinity.py "verify" "$TUNED_isolated_cores_expanded" - retval=$? - if [ $retval -eq 0 -a -f /sys/module/kvm/parameters/kvmclock_periodic_sync ]; then + if [ -f /sys/module/kvm/parameters/kvmclock_periodic_sync ]; then test "$(cat /sys/module/kvm/parameters/kvmclock_periodic_sync)" = 0 retval=$? fi diff --git a/profiles/realtime-virtual-host/tuned.conf b/profiles/realtime-virtual-host/tuned.conf index cab2b73..0346fff 100644 --- a/profiles/realtime-virtual-host/tuned.conf +++ b/profiles/realtime-virtual-host/tuned.conf @@ -39,6 +39,8 @@ group.rcub=0:f:4:*:rcub.* # for i in `pgrep ktimersoftd` ; do grep Cpus_allowed_list /proc/$i/status ; done group.ktimersoftd=0:f:3:*:ktimersoftd.* +ps_blacklist=ksoftirqd.*;rcuc.*;rcub.*;ktimersoftd.* + [script] script=${i:PROFILE_DIR}/script.sh diff --git a/profiles/realtime/script.sh b/profiles/realtime/script.sh index f0ea4d8..4151731 100755 --- a/profiles/realtime/script.sh +++ b/profiles/realtime/script.sh @@ -3,15 +3,7 @@ . /usr/lib/tuned/functions start() { - if [ -z "$TUNED_isolated_cores" ]; then - echo "no isolated cores set, realtime profile not correctly activated" >&2 - exit 1 - fi - - # move threads off the selected cpu cores - tuna -c "$TUNED_isolated_cores" -i - - return "$?" + return 0 } stop() { diff --git a/profiles/realtime/tuned.conf b/profiles/realtime/tuned.conf index 6feee3f..b2273cf 100644 --- a/profiles/realtime/tuned.conf +++ b/profiles/realtime/tuned.conf @@ -40,3 +40,6 @@ cmdline_realtime=+isolcpus=${isolated_cores} intel_pstate=disable nosoftlockup [script] script = ${i:PROFILE_DIR}/script.sh + +[scheduler] +isolated_cores=${isolated_cores}