Bug 1259452 - tuned-profiles-nfv: lapic_timer_adv_ns cache not working
Summary: tuned-profiles-nfv: lapic_timer_adv_ns cache not working
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: tuned
Version: 7.2
Hardware: Unspecified
OS: Unspecified
Target Milestone: rc
: ---
Assignee: Jaroslav Škarvada
QA Contact: Tereza Cerna
Depends On:
Blocks: kvm-rt-tuned 1282567 1273048
TreeView+ depends on / blocked
Reported: 2015-09-02 15:56 UTC by Luiz Capitulino
Modified: 2016-11-04 07:25 UTC (History)
10 users (show)

Fixed In Version: tuned-2.5.1-5.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 1282567 (view as bug list)
Last Closed: 2016-11-04 07:25:01 UTC
tcerna: needinfo-

Attachments (Terms of Use)

System ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2016:2479 normal SHIPPED_LIVE tuned bug fix and enhancement update 2016-11-03 14:08:42 UTC

Description Luiz Capitulino 2015-09-02 15:56:23 UTC
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 15:56:53 UTC
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
@@ -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

Comment 4 Jaroslav Škarvada 2015-11-16 16:30:10 UTC
Upstream commit fixing the problem:

Comment 13 errata-xmlrpc 2016-11-04 07:25:01 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.


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