Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1395855

Summary: cpu-partitioning: disable kvmclock sync and ple
Product: Red Hat Enterprise Linux 7 Reporter: Luiz Capitulino <lcapitulino>
Component: tunedAssignee: Jaroslav Škarvada <jskarvad>
Status: CLOSED ERRATA QA Contact: Tereza Cerna <tcerna>
Severity: unspecified Docs Contact: Lenka Kimlickova <lkimlick>
Priority: high    
Version: 7.4CC: atragler, bhu, jeder, jskarvad, psklenar, tcerna
Target Milestone: rcKeywords: Patch, ZStream
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
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 12:32:51 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1394932, 1400961, 1439156    

Description Luiz Capitulino 2016-11-16 20:13:58 UTC
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 10:27:27 UTC
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 12:32:51 UTC
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