Red Hat Bugzilla – Bug 1395855
cpu-partitioning: disable kvmclock sync and ple
Last modified: 2017-08-01 08:32:51 EDT
The cpu-partitioning profile should disable the kvmclock sync feature and the ple, just as the real-time host profile does. Otherwise, a process running on isolated CPUs will be interrupted by timers or unwanted VM exists. Here's the code to do this (from /usr/lib/tuned/realtime-virtual-host/script.sh): create_modfile() { modinfo -p kvm | grep -q kvmclock_periodic_sync if [ "$?" -eq 0 ]; then echo "options kvm kvmclock_periodic_sync=0" > $modfile fi modinfo -p kvm_intel | grep -q ple_gap if [ "$?" -eq 0 ]; then echo "options kvm_intel ple_gap=0" >> $modfile fi } start() { [...] if [ ! -f $modfile ]; then create_modfile fi [...] } stop() { [...] [ "$1" = "profile_switch" ] && rm -f $modfile [...] } A few observations: 1. In the RT profiles, this code is only part of the host profile. But I guess there's no problem running it in the guest too (meaning, we can keep a single cpu-partitioning profile instead of breaking it into host and guest profiles) 2. modfile should probably be /etc/modprobe.d/kvm-cpu-partitioning.conf 3. Maybe we should create functions in /usr/lib/tuned/functions to handle /etc/modprobe.d files? So that we avoid code duplication like this?
Upstream commits fixing the problem: https://github.com/redhat-performance/tuned/commit/e153bf3ba1a8fc80934c67ece393bc9587638dee https://github.com/redhat-performance/tuned/commit/e25fcb3164bf8a5c93d1ba2a8810d6ea7bb6af82 https://github.com/redhat-performance/tuned/commit/efd686427c1b72a4a6ffe9ea6842a17049822e7f
Verified in: tuned-2.8.0-2.el7.noarch PASS :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: [ LOG ] :: Check that kvmclock sync feature and ple are disabled [BZ#1395855] :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: [ PASS ] :: Command 'ls /etc/modprobe.d | grep kvm.rt.tuned.conf' (Expected 0, got 0) :: [ PASS ] :: Command 'grep N /sys/module/kvm/parameters/kvmclock_periodic_sync' (Expected 0, got 0) :: [ PASS ] :: Command 'grep 0 /sys/module/kvm_intel/parameters/ple_gap' (Expected 0, got 0) :: [ PASS ] :: Command 'tuned-adm profile virtual-guest' (Expected 0, got 0) :: [ PASS ] :: Command 'ls /etc/modprobe.d | grep kvm.rt.tuned.conf' (Expected 1, got 1) :: [ LOG ] :: Duration: 3s :: [ LOG ] :: Assertions: 5 good, 0 bad :: [ PASS ] :: RESULT: Check that kvmclock sync feature and ple are disabled [BZ#1395855]
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2017:2102