Bug 1259452 - tuned-profiles-nfv: lapic_timer_adv_ns cache not working
tuned-profiles-nfv: lapic_timer_adv_ns cache not working
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: tuned (Show other bugs)
7.2
Unspecified Unspecified
high Severity unspecified
: rc
: ---
Assigned To: Jaroslav Škarvada
Tereza Cerna
: ZStream
Depends On:
Blocks: kvm-rt-tuned 1282567 1273048
  Show dependency treegraph
 
Reported: 2015-09-02 11:56 EDT by Luiz Capitulino
Modified: 2016-11-04 03:25 EDT (History)
10 users (show)

See Also:
Fixed In Version: tuned-2.5.1-5.el7
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1282567 (view as bug list)
Environment:
Last Closed: 2016-11-04 03:25:01 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
tcerna: needinfo-


Attachments (Terms of Use)

  None (edit)
Description Luiz Capitulino 2015-09-02 11:56:23 EDT
Description of problem:

Every time I boot my KVM-RT host, I can observe that the file /sys/module/kvm/parameters/lapic_timer_advance_ns keeps changing for minutes. Even after the system is fully booted.

Version-Release number of selected component (if applicable): tuned-profiles-nfv-2.5.1-3.el7.noarch


How reproducible:


Steps to Reproduce:
1. Boot a host with the realtime-virtual-host profile setup
2. After boot, run:

 # watch -n1 cat /sys/module/kvm/parameters/lapic_timer_advance_ns

3. Check the file contents changing every few seconds or so

Actual results:


Expected results:


Additional info:
Comment 1 Luiz Capitulino 2015-09-02 11:56:53 EDT
I've debugged this down to two bugs in the code that implements lapic_timer_adv_ns cache caching. The patch below should fix them:

diff --git a/profiles/realtime-virtual-host/script.sh b/profiles/realtime-virtual-host/script.sh
index 9970b8e..161052c 100755
--- a/profiles/realtime-virtual-host/script.sh
+++ b/profiles/realtime-virtual-host/script.sh
@@ -27,7 +27,7 @@ start() {
         curmodel=`cat /proc/cpuinfo | grep "model name" | cut -f 2 -d ":" | uniq`
         genmodel=`cat lapic_timer_adv_ns.cpumodel`
 
-        if [ "$cpumodel" != "$genmodel" ]; then
+        if [ "$curmodel" != "$genmodel" ]; then
             rm -f lapic_timer_adv_ns
             rm -f lapic_timer_adv_ns.cpumodel
         fi
@@ -43,7 +43,7 @@ start() {
              if [ $? -eq 0 ]; then
                   echo `cat $tempdir/opt.out | cut -f 2 -d ":"` > ./lapic_timer_adv_ns
                   curmodel=`cat /proc/cpuinfo | grep "model name" | cut -f 2 -d ":" | uniq`
-                  echo $curmodel > lapic_timer_adv_ns.cpumodel
+                  echo "$curmodel" > lapic_timer_adv_ns.cpumodel
              fi
         fi
     fi
Comment 4 Jaroslav Škarvada 2015-11-16 11:30:10 EST
Upstream commit fixing the problem:
https://git.fedorahosted.org/cgit/tuned.git/commit/?id=cb826c1e38a3bf68a1c169a2665d2edab72abb2d
Comment 13 errata-xmlrpc 2016-11-04 03:25:01 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://rhn.redhat.com/errata/RHBA-2016-2479.html

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