From 502fe8e560e381c968cc53bd4836af5b79530252 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Nov 10 2020 09:46:42 +0000 Subject: import tuned-2.11.0-10.el7 --- diff --git a/SOURCES/tuned-2.11.0-realtime-virtual-host-remove-lapic-advancement.patch b/SOURCES/tuned-2.11.0-realtime-virtual-host-remove-lapic-advancement.patch new file mode 100644 index 0000000..aa81cff --- /dev/null +++ b/SOURCES/tuned-2.11.0-realtime-virtual-host-remove-lapic-advancement.patch @@ -0,0 +1,144 @@ +diff --git a/profiles/realtime-virtual-host/find-lapictscdeadline-optimal.sh b/profiles/realtime-virtual-host/find-lapictscdeadline-optimal.sh +deleted file mode 100755 +index 539c47e..0000000 +--- a/profiles/realtime-virtual-host/find-lapictscdeadline-optimal.sh ++++ /dev/null +@@ -1,30 +0,0 @@ +-#!/bin/bash +- +-: ${1?"Usage: $0 latency-file"} +- +-lines=`wc -l $1 | cut -f 1 -d " "` +-in_range=0 +-prev_value=1 +-for i in `seq 1 $lines`; do +- a=`awk "NR==$i" $1 | cut -f 2 -d ":"` +- value=$(($a*100/$prev_value)) +- if [ $value -ge 98 -a $value -le 102 ]; then +- in_range=$(($in_range + 1)) +- else +- in_range=0 +- fi +- if [ $in_range -ge 2 ]; then +- echo -n "optimal value for lapic_timer_advance_ns is: " +- awk "NR==$(($i - 1))" $1 | cut -f 1 -d ":" +- exit 0 +- fi +- prev_value=$a +-done +-# if still decreasing, then use highest ns value +-if [ $value -le 99 ]; then +- echo -n "optimal value for lapic_timer_advance_ns is: " +- awk "NR==$(($i - 1))" $1 | cut -f 1 -d ":" +- exit 0 +-fi +-echo optimal not found +-exit 1 +diff --git a/profiles/realtime-virtual-host/script.sh b/profiles/realtime-virtual-host/script.sh +index edae6c5..a11dac7 100755 +--- a/profiles/realtime-virtual-host/script.sh ++++ b/profiles/realtime-virtual-host/script.sh +@@ -2,103 +2,13 @@ + + . /usr/lib/tuned/functions + +-CACHE_VALUE_FILE=./lapic_timer_adv_ns +-CACHE_CPU_FILE=./lapic_timer_adv_ns.cpumodel +-KVM_LAPIC_FILE=/sys/module/kvm/parameters/lapic_timer_advance_ns + KTIMER_LOCKLESS_FILE=/sys/kernel/ktimer_lockless_check +-QEMU=$(type -P qemu-kvm || echo /usr/libexec/qemu-kvm) +-TSCDEADLINE_LATENCY="/usr/share/qemu-kvm/tscdeadline_latency.flat" +-if [ ! -f "$TSCDEADLINE_LATENCY" ]; then +- TSCDEADLINE_LATENCY="/usr/share/tuned/tscdeadline_latency.flat" +-fi +- +-run_tsc_deadline_latency() +-{ +- dir=`mktemp -d` +- +- for i in `seq 1000 500 7000`; do +- echo $i > $KVM_LAPIC_FILE +- +- 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 \ +- -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" | ncat -U $unixpath | grep thread_id | cut -f 3 -d "=" | tr -d "\r"` +- taskset -p -c $1 $pidofvcpu >/dev/null +- echo "cont" | ncat -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 +- +- A=0 +- while read l; do +- A=$(($A+$l)) +- done < $dir/out +- +- lines=`wc -l $dir/out | cut -f 1 -d " "` +- ans=$(($A/$lines)) +- echo $i: $ans +- done +-} + + start() { + setup_kvm_mod_low_latency + + disable_ksm + +- # If CPU model has changed, clean the cache +- if [ -f $CACHE_CPU_FILE ]; then +- curmodel=`cat /proc/cpuinfo | grep "model name" | cut -f 2 -d ":" | uniq` +- if [ -z "$curmodel" ]; then +- die failed to read CPU model +- fi +- +- genmodel=`cat $CACHE_CPU_FILE` +- +- if [ "$curmodel" != "$genmodel" ]; then +- rm -f $CACHE_VALUE_FILE +- rm -f $CACHE_CPU_FILE +- fi +- fi +- +- # If the cache is empty, find the best lapic_timer_advance_ns value +- # and cache it +- +- if [ ! -f $KVM_LAPIC_FILE ]; then +- die $KVM_LAPIC_FILE not found +- fi +- +- if [ ! -f $CACHE_VALUE_FILE ]; then +- if [ -f "$TSCDEADLINE_LATENCY" ]; then +- tempdir=`mktemp -d` +- isolatedcpu=`echo "$TUNED_isolated_cores_expanded" | cut -f 1 -d ","` +- run_tsc_deadline_latency $isolatedcpu > $tempdir/lat.out +- if ! ./find-lapictscdeadline-optimal.sh $tempdir/lat.out > $tempdir/opt.out; then +- die could not find optimal latency +- fi +- echo `cat $tempdir/opt.out | cut -f 2 -d ":"` > $CACHE_VALUE_FILE +- curmodel=`cat /proc/cpuinfo | grep "model name" | cut -f 2 -d ":" | uniq` +- echo "$curmodel" > $CACHE_CPU_FILE +- fi +- fi +- +- if [ -f $CACHE_VALUE_FILE ]; then +- echo `cat $CACHE_VALUE_FILE` > $KVM_LAPIC_FILE +- fi + systemctl start rt-entsk + + if [ -f $KTIMER_LOCKLESS_FILE ]; then diff --git a/SPECS/tuned.spec b/SPECS/tuned.spec index 7532bec..5e4c0a6 100644 --- a/SPECS/tuned.spec +++ b/SPECS/tuned.spec @@ -7,7 +7,7 @@ Summary: A dynamic adaptive system tuning daemon Name: tuned Version: 2.11.0 -Release: 9%{?prerel1}%{?dist} +Release: 10%{?prerel1}%{?dist} 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/ @@ -37,6 +37,7 @@ Patch9: tuned-2.11.0-irqbalance-tuning.patch Patch10: tuned-2.11.0-netcat-requirement.patch Patch11: tuned-2.11.0-reapply-sysctl-ignore-usr.patch Patch12: tuned-2.11.0-define-variables-before-use.patch +Patch13: tuned-2.11.0-realtime-virtual-host-remove-lapic-advancement.patch %description The tuned package contains a daemon that tunes system settings dynamically. @@ -139,7 +140,7 @@ Summary: Additional tuned profile(s) targeted to Network Function Virtualization Requires: %{name} = %{version} Requires: %{name}-profiles-realtime = %{version} Requires: nmap-ncat -Requires: tuna, qemu-kvm-tools-rhev +Requires: tuna %description profiles-nfv-host Additional tuned profile(s) targeted to Network Function Virtualization (NFV) host. @@ -183,6 +184,7 @@ It can be also used to fine tune your system for specific scenarios. %patch10 -p1 %patch11 -p1 %patch12 -p1 +%patch13 -p1 %build @@ -434,6 +436,11 @@ fi %{_mandir}/man7/tuned-profiles-compat.7* %changelog +* Wed Aug 12 2020 Jaroslav Škarvada - 2.11.0-10 +- realtime-virtual-host: remove lapic advancement calculation and + related qemu-kvm-tools-rhev requirement + Resolves: rhbz#1852253 + * Thu Mar 5 2020 Jaroslav Škarvada - 2.11.0-9 - Fixed SIGHUP handling Resolves: rhbz#1702724