Bug 1690929

Summary: Tuned tries to set energy_perf_bias on platforms that do not support it.
Product: Red Hat Enterprise Linux 8 Reporter: Jiří Mencák <jmencak>
Component: tunedAssignee: Jaroslav Škarvada <jskarvad>
Status: CLOSED ERRATA QA Contact: Robin Hack <rhack>
Severity: medium Docs Contact:
Priority: medium    
Version: 8.0CC: jeder, jskarvad, olysonek, rhack, thozza
Target Milestone: rcKeywords: Patch, Upstream
Target Release: 8.0Flags: pm-rhel: mirror+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: tuned-2.13.0-0.1.rc1.el8 Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-04-28 16:59:29 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: 1743192, 1755139    

Description Jiří Mencák 2019-03-20 13:38:49 UTC
Description of problem:
The package responsible for setting MSR_IA32_ENERGY_PERF_BIAS policies (x86_energy_perf_policy) has been updated in RHEL 8 and it no longer exits 1 (like in RHEL 7) when invoked with '-r' option and it is unable to find any CPUs to which the policies could be applied.  This causes tuned to go ahead and apply the policies nevertheless and fail with an error.

Version-Release number of selected component (if applicable):
[root@b5 ~]# rpm -qf `which tuned-adm`
tuned-2.10.0-7.el8.noarch
[root@b5 ~]# rpm -qf `which x86_energy_perf_policy`
kernel-tools-4.18.0-32.el8.x86_64

How reproducible:
Always 

Steps to Reproduce:
1. Start RHEL8/RHCoS8 in a kvm host.
2. systemctl stop tuned
3. tuned --no-dbus

Actual results:
2019-03-20 09:24:59,482 ERROR    tuned.plugins.plugin_cpu: Failed to set energy_perf_bias on cpu 'cpu0'. Is the value in the profile correct?

Expected results:
Issue just a WARNING like on RHEL7.

Additional info:
"x86_energy_perf_policy -r" seems to output CPUs only when it seems to be able to apply the policies.  Haven't checked the source code for it though, so just my assumption.

Comment 1 Robin Hack 2019-07-10 08:15:54 UTC
Looks like test: /CoreOS/tuned/Regression/check-no-hdparm-error-when-executing-tuned-profile
is able to trigger this issue.

2019-07-10 03:58:59,779 INFO     tuned.daemon.daemon: stopping tuning
2019-07-10 03:58:59,782 INFO     tuned.profiles.loader: loading profile: virtual-guest
2019-07-10 03:58:59,783 INFO     tuned.daemon.daemon: starting tuning
2019-07-10 03:58:59,788 INFO     tuned.plugins.base: instance cpu: assigning devices cpu6, cpu19, cpu17, cpu14, cpu13, cpu10, cpu9, cpu22, cpu0, cpu5, cpu16, cpu15, cpu1, cp
u2, cpu23, cpu12, cpu8, cpu4, cpu3, cpu20, cpu7, cpu18, cpu11, cpu21
2019-07-10 03:58:59,789 INFO     tuned.plugins.plugin_cpu: We are running on an x86 GenuineIntel platform
2019-07-10 03:58:59,797 INFO     tuned.plugins.base: instance disk: assigning devices vda
2019-07-10 03:58:59,812 ERROR    tuned.plugins.plugin_cpu: Failed to set energy_perf_bias on cpu 'cpu6'. Is the value in the profile correct?
2019-07-10 03:58:59,821 ERROR    tuned.plugins.plugin_cpu: Failed to set energy_perf_bias on cpu 'cpu19'. Is the value in the profile correct?
2019-07-10 03:58:59,831 ERROR    tuned.plugins.plugin_cpu: Failed to set energy_perf_bias on cpu 'cpu8'. Is the value in the profile correct?
2019-07-10 03:58:59,840 ERROR    tuned.plugins.plugin_cpu: Failed to set energy_perf_bias on cpu 'cpu4'. Is the value in the profile correct?
2019-07-10 03:58:59,850 ERROR    tuned.plugins.plugin_cpu: Failed to set energy_perf_bias on cpu 'cpu3'. Is the value in the profile correct?
2019-07-10 03:58:59,859 ERROR    tuned.plugins.plugin_cpu: Failed to set energy_perf_bias on cpu 'cpu17'. Is the value in the profile correct?
2019-07-10 03:58:59,868 ERROR    tuned.plugins.plugin_cpu: Failed to set energy_perf_bias on cpu 'cpu14'. Is the value in the profile correct?
2019-07-10 03:58:59,878 ERROR    tuned.plugins.plugin_cpu: Failed to set energy_perf_bias on cpu 'cpu20'. Is the value in the profile correct?
2019-07-10 03:58:59,888 ERROR    tuned.plugins.plugin_cpu: Failed to set energy_perf_bias on cpu 'cpu13'. Is the value in the profile correct?
2019-07-10 03:58:59,897 ERROR    tuned.plugins.plugin_cpu: Failed to set energy_perf_bias on cpu 'cpu10'. Is the value in the profile correct?
2019-07-10 03:58:59,907 ERROR    tuned.plugins.plugin_cpu: Failed to set energy_perf_bias on cpu 'cpu9'. Is the value in the profile correct?
2019-07-10 03:58:59,917 ERROR    tuned.plugins.plugin_cpu: Failed to set energy_perf_bias on cpu 'cpu7'. Is the value in the profile correct?
2019-07-10 03:58:59,926 ERROR    tuned.plugins.plugin_cpu: Failed to set energy_perf_bias on cpu 'cpu22'. Is the value in the profile correct?

Comment 2 Robin Hack 2019-07-10 08:16:37 UTC
Used environment: 1minutetip machine with 24 cpu.

Comment 6 Ondřej Lysoněk 2019-11-22 13:33:36 UTC
Upstream PR:
https://github.com/redhat-performance/tuned/pull/217

Comment 7 Ondřej Lysoněk 2019-11-25 14:44:32 UTC
(In reply to Ondřej Lysoněk from comment #6)
> Upstream PR:
> https://github.com/redhat-performance/tuned/pull/217

It got merged.

Comment 14 errata-xmlrpc 2020-04-28 16:59:29 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-2020:1883