diff --git a/SOURCES/tuned-2.10.0-realtime-virtual-host-pin-only-vcpu-thread-to-isolated-pcpu.patch b/SOURCES/tuned-2.10.0-realtime-virtual-host-pin-only-vcpu-thread-to-isolated-pcpu.patch new file mode 100644 index 0000000..4c02ba3 --- /dev/null +++ b/SOURCES/tuned-2.10.0-realtime-virtual-host-pin-only-vcpu-thread-to-isolated-pcpu.patch @@ -0,0 +1,70 @@ +From 4790e570ce0e41bde4e1866ed6e3cba723b5f4d8 Mon Sep 17 00:00:00 2001 +From: Marcelo Tosatti +Date: Wed, 4 Jul 2018 17:30:37 -0300 +Subject: [PATCH] realtime-virtual-host: pin only the vcpu thread to isolated + pCPU (v2) + +As noted in the bugzilla ticket + +https://bugzilla.redhat.com/show_bug.cgi?id=1554851 + +The QEMU I/O thread can interrupt the time measurement +of the timer. To avoid this problem, only +pin the vCPU thread. + +Signed-off-by: Marcelo Tosatti +Reviewed-and-Tested-by: Luiz Capitulino + +v2: + - Use unix sockets (Luiz) + - Proper numeric output (Luiz) +--- + profiles/realtime-virtual-host/script.sh | 31 ++++++++++++++++-------- + 1 file changed, 21 insertions(+), 10 deletions(-) + +diff --git a/profiles/realtime-virtual-host/script.sh b/profiles/realtime-virtual-host/script.sh +index 515d2547..32e962db 100755 +--- a/profiles/realtime-virtual-host/script.sh ++++ b/profiles/realtime-virtual-host/script.sh +@@ -17,20 +17,31 @@ run_tsc_deadline_latency() + + for i in `seq 1000 500 7000`; do + echo $i > $KVM_LAPIC_FILE +- chrt -f 1 taskset -c $1 $QEMU -enable-kvm -device pc-testdev \ ++ ++ unixpath=`mktemp` ++ ++ chrt -f 1 $QEMU -S -enable-kvm -device pc-testdev \ + -device isa-debug-exit,iobase=0xf4,iosize=0x4 \ + -display none -serial stdio -device pci-testdev \ + -kernel "$TSCDEADLINE_LATENCY" \ +- -cpu host | grep latency | cut -f 2 -d ":" > $dir/out +- +- if [ ! -f $dir/out ]; then +- die running $TSCDEADLINE_LATENCY failed +- fi ++ -cpu host \ ++ -mon chardev=char0,mode=readline \ ++ -chardev socket,id=char0,nowait,path=$unixpath,server | grep latency | cut -f 2 -d ":" > $dir/out & ++ ++ sleep 1s ++ pidofvcpu=`echo "info cpus" | nc -U $unixpath | grep thread_id | cut -f 3 -d "=" | tr -d "\r"` ++ taskset -p -c $1 $pidofvcpu >/dev/null ++ echo "cont" | nc -U $unixpath >/dev/null ++ wait ++ ++ if [ ! -f $dir/out ]; then ++ die running $TSCDEADLINE_LATENCY failed ++ fi + +- tmp=$(wc -l $dir/out | awk '{ print $1 }') +- if [ $tmp -eq 0 ]; then +- die running $TSCDEADLINE_LATENCY failed +- fi ++ tmp=$(wc -l $dir/out | awk '{ print $1 }') ++ if [ $tmp -eq 0 ]; then ++ die running $TSCDEADLINE_LATENCY failed ++ fi + + A=0 + while read l; do diff --git a/SPECS/tuned.spec b/SPECS/tuned.spec index abd0934..52487c7 100644 --- a/SPECS/tuned.spec +++ b/SPECS/tuned.spec @@ -7,7 +7,7 @@ Summary: A dynamic adaptive system tuning daemon Name: tuned Version: 2.10.0 -Release: 6%{?prerel1}%{?dist}.3 +Release: 6%{?prerel1}%{?dist}.4 License: GPLv2+ Source: https://github.com/redhat-performance/%{name}/archive/v%{version}%{?prerel2}.tar.gz#/%{name}-%{version}%{?prerel2}.tar.gz URL: http://www.tuned-project.org/ @@ -26,6 +26,7 @@ Patch1: tuned-2.10.0-use-online-cpus.patch Patch2: tuned-2.10.0-realtime-virtual-enable-rt-entsk.patch Patch3: tuned-2.10.0-disable-ksm-once.patch Patch4: tuned-2.10.0-update-kvm-modprobe-file.patch +Patch5: tuned-2.10.0-realtime-virtual-host-pin-only-vcpu-thread-to-isolated-pcpu.patch %description The tuned package contains a daemon that tunes system settings dynamically. @@ -164,6 +165,8 @@ It can be also used to fine tune your system for specific scenarios. %patch2 -p1 %patch3 -p1 %patch4 -p1 +%patch5 -p1 + # workaround for https://bugzilla.redhat.com/show_bug.cgi?id=1626473 chmod 0755 profiles/realtime-virtual-guest/script.sh @@ -416,6 +419,10 @@ fi %{_mandir}/man7/tuned-profiles-compat.7* %changelog +* Wed Jul 10 2019 Jaroslav Škarvada - 2.10.0-6.4 +- realtime-virtual-host: pin only the vcpu thread to isolated pcpu + Resolves: rhbz#1728699 + * Tue Nov 27 2018 Jaroslav Škarvada - 2.10.0-6.3 - Reworked setup_kvm_mod_low_latency to count with kernel changes Resolves: rhbz#1653767