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] 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}