Bug 1395855 - cpu-partitioning: disable kvmclock sync and ple
cpu-partitioning: disable kvmclock sync and ple
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: tuned (Show other bugs)
7.4
Unspecified Unspecified
high Severity unspecified
: rc
: ---
Assigned To: Jaroslav Škarvada
Tereza Cerna
Lenka Kimlickova
: Patch, ZStream
Depends On:
Blocks: 1394932 1400961 1439156
  Show dependency treegraph
 
Reported: 2016-11-16 15:13 EST by Luiz Capitulino
Modified: 2017-08-01 08:32 EDT (History)
6 users (show)

See Also:
Fixed In Version: tuned-2.8.0-1.el7
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1439156 (view as bug list)
Environment:
Last Closed: 2017-08-01 08:32:51 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Luiz Capitulino 2016-11-16 15:13:58 EST
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?
Comment 6 Tereza Cerna 2017-04-26 06:27:27 EDT
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]
Comment 10 errata-xmlrpc 2017-08-01 08:32:51 EDT
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

Note You need to log in before you can comment on or make changes to this bug.