Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Description of problem:
When applying a profile with multiple inheritance where both parent profiles include a common ancestor Tuned daemon will fail to apply it.
Version-Release number of selected component (if applicable):
NAME="Red Hat Enterprise Linux"
VERSION="8.2 (Ootpa)"
ID="rhel"
ID_LIKE="fedora"
VERSION_ID="8.2"
PLATFORM_ID="platform:el8"
PRETTY_NAME="Red Hat Enterprise Linux 8.2 (Ootpa)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:redhat:enterprise_linux:8.2:GA"
HOME_URL="https://www.redhat.com/"
BUG_REPORT_URL="https://bugzilla.redhat.com/"REDHAT_BUGZILLA_PRODUCT="Red Hat Enterprise Linux 8"
REDHAT_BUGZILLA_PRODUCT_VERSION=8.2
REDHAT_SUPPORT_PRODUCT="Red Hat Enterprise Linux"
REDHAT_SUPPORT_PRODUCT_VERSION="8.2"
How reproducible:
Always
Steps to Reproduce:
[root@b82 ~]# yum install tuned-profiles-cpu-partitioning -y
[root@b82 ~]# systemctl stop tuned --now
[root@b82 ~]# echo '[openshift-realtime]' > /etc/tuned/recommend.d/50-openshift.conf
[root@b82 ~]# rm -f /etc/tuned/{active_profile,profile_mode}
[root@b82 ~]# mkdir -p /etc/tuned/{openshift-realtime,realtime}
[root@b82 ~]# cat > /etc/tuned/openshift-realtime/tuned.conf <<EOF
[main]
summary=Custom OpenShift realtime profile
include=cpu-partitioning,realtime
EOF
[root@b82 ~]# cat > /etc/tuned/realtime/tuned.conf <<EOF
[main]
summary=Optimize for realtime workloads
include = network-latency
EOF
Actual results:
Profile with multiple inheritance fails due to:
[root@b82 ~]# tuned --no-dbus
2020-04-20 08:00:14,649 INFO tuned.daemon.application: dynamic tuning is globally disabled
2020-04-20 08:00:14,651 INFO tuned.daemon.daemon: using sleep interval of 1 second(s)
2020-04-20 08:00:14,652 INFO tuned.daemon.daemon: Running in automatic mode, checking what profile is recommended for your configuration.
2020-04-20 08:00:14,652 INFO tuned.daemon.daemon: Using 'openshift-realtime' profile
2020-04-20 08:00:14,653 INFO tuned.profiles.loader: loading profile: openshift-realtime
2020-04-20 08:00:14,655 ERROR tuned.daemon.daemon: Cannot set initial profile. No tunings will be enabled: Cannot load profile(s) 'openshift-realtime': Cannot find profile 'network-latency' in '['/etc/tuned', '/usr/lib/tuned']'.
2020-04-20 08:00:14,655 INFO tuned.daemon.controller: starting controller
^C2020-04-20 08:00:17,390 INFO tuned.daemon.controller: terminating controller[root@b82 ~]# ls -l /usr/lib/tuned/network-latency/tuned.conf
-rw-r--r--. 1 root root 366 Dec 11 12:13 /usr/lib/tuned/network-latency/tuned.conf
Expected results:
Custom profile should be applied successfully.
Additional info:
Possible reason for failure is mentioned in comments.
Looking at loader.py :
def _load_profile(self, profile_names, profiles, processed_files):
for name in profile_names:
filename = self._profile_locator.get_config(name, processed_files)
if filename is None:
raise InvalidProfileException("Cannot find profile '%s' in '%s'." % (name, list(reversed(self._profile_locator._load_directories))))
processed_files.append(filename)
config = self._load_config_data(filename)
profile = self._profile_factory.create(name, config)
if "include" in profile.options:
include_names = re.split(r"\b\s*[,;]\s*", self._variables.expand(profile.options.pop("include")))
self._load_profile(include_names, profiles, processed_files)
profiles.append(profile)
It seems that self._profile_locator.get_config(name, processed_files) is probably invoked twice with an ancestor profile.
If an ancestor profile was already processed and added processed_files.append(filename) it won't be obtained again and be skipped:
locator.py :
def get_config(self, profile_name, skip_files=None):
for dir_name in reversed(self._load_directories):
# basename is protection not to get out of the path
config_file = self._get_config_filename(dir_name, os.path.basename(profile_name))
if skip_files is not None and config_file in skip_files:
continue
if os.path.isfile(config_file):
return config_file
return None
In the bug description we use realtime and cpu-partitioning profiles that have a common ancestor : network-latency that fails to be obtained according to the log.
There is also a need to consider the case where there is a transitive inheritance , for example:
realtime-> network-latency -> latency-performance
cpu-partitioning -> network-latency -> latency-performance
latency-performance should not be also a reason for a failure in case we overcome the first ancestor.
Created attachment 1788804[details]
Proposed patch to address this issue.
Proposing a patch to address this issue. Might break some unit tests, but seems to address the problem.
Comment 14Jaroslav Škarvada
2021-06-09 00:26:43 UTC
Created attachment 1789468[details]
Proposed fix
I address the following:
- unit test fixes
- fix the problem (regression) when customized profile PROFILE (in /etc/tuned) uses include=PROFILE (for customizing the stock profiles from the /usr/share/tuned)
I will give you credit in the upstream git.
I am going to give it a bit more thinking whether this simplified profile loading could introduce some unexpected situations (e.g. with 'replace=true').
Comment 15Jaroslav Škarvada
2021-06-09 08:53:26 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 (tuned bug fix and enhancement update), 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-2021:4476
Comment 25Red Hat Bugzilla
2023-09-15 00:31:05 UTC
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 500 days