Bug 1267284

Summary: tuned-profiles-nfv: find-lapictscdeadline-optimal.sh is failing
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:
Priority: high    
Version: 7.3CC: bhu, hhuang, jeder, jscotka, jskarvad, lcapitulino, lmiksik, mtosatti, riehecky, tcerna, tlavigne
Target Milestone: rcKeywords: ZStream
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: tuned-2.5.1-5.el7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1282592 (view as bug list) Environment:
Last Closed: 2016-11-04 07:25:35 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: 1240765, 1273048, 1282592    
Attachments:
Description Flags
lat.out that reproduces the issue none

Description Luiz Capitulino 2015-09-29 14:22:32 UTC
Created attachment 1078384 [details]
lat.out that reproduces the issue

Description of problem:

We've been seeing that in some systems the files lapic_timer_adv_ns and lapic_timer_adv_ns.cpumodel are not being created in /usr/lib/tuned/realtime-virtual-host/.

I've debugged this issue down to find-lapictscdeadline-optimal.sh (silently) failing when run by tuned.

I'm attaching the lat.out file that reproduces the issue:

[root@virtlab401 realtime-virtual-host]# ./find-lapictscdeadline-optimal.sh /tmp/tmp.ZjZlVhDqe8/lat.out 
optimal not found
[root@virtlab401 realtime-virtual-host]# 

Btw, in those systems we ended up with 7000 written to /sys/module/kvm/parameters/lapic_timer_advance_ns, just because that's the last value tried by run-tscdeadline-latency.sh.


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


How reproducible:


Steps to Reproduce:
1. Setup a KVM-RT host
2. The following files don't exist:
  * /usr/lib/tuned/realtime-virtual-host/lapic_timer_adv_ns
  * /usr/lib/tuned/realtime-virtual-host/lapic_timer_adv_ns.cpumodel
3. /sys/module/kvm/parameters/lapic_timer_advance_ns is 7000

Comment 1 Jaroslav Škarvada 2015-10-02 10:11:47 UTC
Upstream commit:
https://git.fedorahosted.org/cgit/tuned.git/commit/?id=874762b4c06e3bc7862e119ee12a23a16352f649

Also I am going to move:
/usr/lib/tuned/realtime-virtual-host/lapic_timer_adv_ns
/usr/lib/tuned/realtime-virtual-host/lapic_timer_adv_ns.cpumodel

to /var/lib/tuned/...

This is according to FHS and should also help with SELinux (if enabled).

Comment 7 Jaroslav Škarvada 2015-11-16 17:32:07 UTC
(In reply to Jaroslav Škarvada from comment #1)
> Upstream commit:
> https://git.fedorahosted.org/cgit/tuned.git/commit/
> ?id=874762b4c06e3bc7862e119ee12a23a16352f649
>
Using this commit as the fix for this bugzilla.

> Also I am going to move:
> /usr/lib/tuned/realtime-virtual-host/lapic_timer_adv_ns
> /usr/lib/tuned/realtime-virtual-host/lapic_timer_adv_ns.cpumodel
> 
> to /var/lib/tuned/...
> 
> This is according to FHS and should also help with SELinux (if enabled).
>
Postponing this specific change to later 7.3 rebase.

Comment 10 Tereza Cerna 2016-09-09 09:16:10 UTC
Hi,

I'm confused from this bug and I don't know what is really expected result. What everything should be set and work? What all should I do for testing this bug?

# tuned-adm profile realtime-virtual-host

# ./find-lapictscdeadline-optimal.sh lat.out 
./find-lapictscdeadline-optimal.sh: line 10: *100/ 3429: syntax error: operand expected (error token is "*100/ 3429")
optimal value for lapic_timer_advance_ns is: 7000

>> Optimal value seems well - 7000 - like in description.
>> There is syntax error, should I create a bug?

# cat /sys/module/kvm/parameters/lapic_timer_advance_ns
1000

>> Why there is 1000 and not 7000?

# ls /usr/lib/tuned/realtime-virtual-host
find-lapictscdeadline-optimal.sh  lat.out  run-tscdeadline-latency.sh  script.sh  tuned.conf
# ls /var/lib/tuned
ls: cannot access /var/lib/tuned: No such file or directory

>> Files lapic_timer_adv_ns and lapic_timer_adv_ns.cpumodel are missing in /usr/lib/tuned/realtime-virtual-host and /var/lib/tuned. Where is it? Are these files necessary?

# rpm -q tuned
tuned-2.7.1-2.el7.noarch

Comment 11 Tereza Cerna 2016-09-09 09:21:16 UTC
There is behavior on old tuned package:

# tuned-adm profile realtime-virtual-host

# ./find-lapictscdeadline-optimal.sh lat.out 
optimal value for lapic_timer_advance_ns is: 6500

# cat /sys/module/kvm/parameters/lapic_timer_advance_ns 
1000

# ls /usr/lib/tuned/realtime-virtual-host/
find-lapictscdeadline-optimal.sh  lat.out  run-tscdeadline-latency.sh  script.sh  tuned.conf
# ls /var/lib/tuned
ls: cannot access /var/lib/tuned: No such file or directory

# rpm -q tuned
tuned-2.5.1-4.el7_2.3.noarch

Comment 12 Luiz Capitulino 2016-09-09 13:01:22 UTC
Is lat.out the one attached in this BZ? If it is, then I can't explain why it is working for you. But at the same time, this was a minor bug and I don't think it's worth it to spend time trying to figure out how an old version of tuned used to work.

In this case, I'd recommend skipping verification for this one.

Comment 15 errata-xmlrpc 2016-11-04 07:25:35 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://rhn.redhat.com/errata/RHBA-2016-2479.html