Bug 1461509 - realtime-virtual-host: error doesn't prevent profile from getting applied
realtime-virtual-host: error doesn't prevent profile from getting applied
Status: NEW
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: tuned (Show other bugs)
Unspecified Unspecified
unspecified Severity unspecified
: rc
: ---
Assigned To: Luiz Capitulino
Depends On:
Blocks: kvm-rt-tuned
  Show dependency treegraph
Reported: 2017-06-14 11:56 EDT by Luiz Capitulino
Modified: 2017-10-18 14:41 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Luiz Capitulino 2017-06-14 11:56:43 EDT
Description of problem:

The realtime-virtual-host profile seems to be missing some error checks. This causes the profile to get applied even though the configuration has failed.

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

How reproducible:

Steps to Reproduce:
1. Make sure the realtime-virtual-host is not applied and clear its cache files

# tuned-adm profile desktop (or any other profile_
# rm -f /usr/lib/tuned/realtime-virtual-host/{lapic_timer_adv_ns,lapic_timer_adv_ns.cpumodel}

2. Install the kernel-rt package without installing kernel-rt-kvm OR temporarily unload kvm modules and rename them

3. Active the realtime-virtual-host profile and check it has succeeded

# tuned-adm profile realtime-virtual-host
# echo $?

4. The problem hasn't been correctly applied because a VM is ran during the activation process. This can be confirmed by checking that the lapic_timer files from step 1 weren't created

NOTE: Maybe things will get automatically fixed if the modules are loaded and tuned restarted or the machine reboots. But this is still something to be fixed.
Comment 2 Luiz Capitulino 2017-06-26 13:47:22 EDT
Note to self: it's probably a good idea to check all profiles for this problem.
Comment 3 Luiz Capitulino 2017-10-13 13:06:56 EDT
I'm not sure I'll be able to fix this for 7.5, since this missed tuned release boat. So, I think it's important we're aware of this issue's impact:

1. This BZ is really about the realtime-virtual-host missing almost all error checking. Actually, this is common among all tuned profiles, but this profile has code that can fail in a reproducible way (see comment 4)

2. I also found that the realtime-virtual-host profile has broken bash code, which fails at every single run. As it fails silently, we never knew it. Luckily (or not), it's just a sanity check that's being skipped

3. The very worst case scenario for this bug is fundamental step failing (such as running tuna to isolated a CPU) and we not seeing it since this fails silently. But this has never happened in practice

4. What seems to be a reproducible way to get trig this bug (which is what I got originally) is:

A. the kernel-rt package is installed but kernel-rt-kvm is not
B. The realtime-virtual-host profile is activated
C. Finding the best latency for the advance timer feature will silently fail, since the kvm module is not loaded
D. The profile is applied
E. kernel-rt-kvm is installed
F. A realtime guest is started
H. realtime guest will get spikes, since /sys/module/kvm/parameters/lapic_timer_advance_ns=0

However, rebooting or reloading tuned after step E should fix things up.
Comment 4 Luiz Capitulino 2017-10-18 14:41:49 EDT
This issue doesn't reproduce very easily and it has an workaround. Let's move to 7.6, as this missed the tuned release.

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