1
0
Fork 0
tuned/profiles/realtime-virtual-host/script.sh
Jaroslav Škarvada 962bae3d71
realtime profiles: dropped tuna invocation from host/guest
Tuna is already executed in the realtime profile which is included by
the realtime-virtual-host/guest profiles, there is no need to execute
it twice. Also fixed minor whitespace inconsistency.

Related: rhbz#1472840

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2017-07-19 18:35:17 +02:00

66 lines
2.1 KiB
Bash
Executable file

#!/bin/sh
. /usr/lib/tuned/functions
ltanfile=/sys/module/kvm/parameters/lapic_timer_advance_ns
start() {
python /usr/libexec/tuned/defirqaffinity.py "remove" "$TUNED_isolated_cores_expanded" &&
retval = "$?"
if [ ! $retval -eq 0 ]; then
return $retval
fi
setup_kvm_mod_low_latency
if [ -f lapic_timer_adv_ns.cpumodel ]; then
curmodel=`cat /proc/cpuinfo | grep "model name" | cut -f 2 -d ":" | uniq`
genmodel=`cat lapic_timer_adv_ns.cpumodel`
if [ "$curmodel" != "$genmodel" ]; then
rm -f lapic_timer_adv_ns
rm -f lapic_timer_adv_ns.cpumodel
fi
fi
if [ -f $ltanfile -a ! -f ./lapic_timer_adv_ns ]; then
if [ -f /usr/share/qemu-kvm/tscdeadline_latency.flat ]; then
tempdir=`mktemp -d`
isolatedcpu=`echo "$TUNED_isolated_cores_expanded" | cut -f 1 -d ","`
sh ./run-tscdeadline-latency.sh $isolatedcpu > $tempdir/lat.out
sh ./find-lapictscdeadline-optimal.sh $tempdir/lat.out > $tempdir/opt.out
if [ $? -eq 0 ]; then
echo `cat $tempdir/opt.out | cut -f 2 -d ":"` > ./lapic_timer_adv_ns
curmodel=`cat /proc/cpuinfo | grep "model name" | cut -f 2 -d ":" | uniq`
echo "$curmodel" > lapic_timer_adv_ns.cpumodel
fi
fi
fi
if [ -f $ltanfile -a -f ./lapic_timer_adv_ns ]; then
echo `cat ./lapic_timer_adv_ns` > $ltanfile
fi
return $retval
}
stop() {
[ "$1" = "full_rollback" ] && teardown_kvm_mod_low_latency
python /usr/libexec/tuned/defirqaffinity.py "add" "$TUNED_isolated_cores_expanded"
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
retval = `cat /sys/module/kvm/parameters/kvmclock_periodic_sync`
fi
if [ $retval -eq 0 -a -f /sys/module/kvm_intel/parameters/ple_gap ]; then
retval = `cat /sys/module/kvm_intel/parameters/ple_gap`
fi
return $retval
}
process $@