Bug 1571403
Summary: | If grub.cfg is missing, then profile cleanup doesn't occur when switching tuned profiles. | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 7 | Reporter: | Ryan Blakley <rblakley> |
Component: | tuned | Assignee: | Jaroslav Škarvada <jskarvad> |
Status: | CLOSED ERRATA | QA Contact: | Dominik Rehák <drehak> |
Severity: | medium | Docs Contact: | |
Priority: | medium | ||
Version: | 7.5 | CC: | aaron_wilk, drehak, jeder, jskarvad, olysonek, tcerna |
Target Milestone: | rc | Keywords: | Patch, Upstream |
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | tuned-2.10.0-0.1.rc1.el7 | Doc Type: | If docs needed, set a value |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2018-10-30 10:50:19 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: |
Description
Ryan Blakley
2018-04-24 17:17:44 UTC
Upstream report: https://github.com/redhat-performance/tuned/issues/82 Pull request: https://github.com/redhat-performance/tuned/pull/96 Upstream commit: https://github.com/redhat-performance/tuned/commit/dce9ad294149617f8dabd126c4a36e6015ca809e @Ondřej, reviewing the commit from PR 96 it seems the only change was to log an error and then return from the function _remove_grub2_tuning without doing anything to the grub2 file. The problem described in this BZ is related to the optional script in the "[script]" from the profile we're moving away from getting called again with the "start" parameter after the grub2 failure. Tuned later prints a message in /var/log/tuned.log that the new profile we requested was successfully applied yet tuned re-applied the script from the previous profile. Here is an condensed example of what's going on during the profile switch from a profile that had a script to one that doesn't (and grub2.cfg is missing). This was taken from logs included in https://access.redhat.com/support/cases/#/case/02018625 root@ventris-pa-arch-strtus02-45 ~$ tuned-adm profile balanced root@ventris-pa-arch-strtus02-45 ~$ grep -Ei "applied|reapplying|plugin_bootloader|loading.profile|cpu_tweaks.sh|error" /var/log/tuned/tuned.log* 2018-04-17 16:47:53,120 INFO tuned.plugins.plugin_script: calling script '/etc/tuned/vde-performance/cpu_tweaks.sh' with arguments '['stop', 'full_rollback']' 2018-04-17 16:47:53,164 INFO tuned.plugins.plugin_bootloader: removing grub2 tuning previously added by Tuned 2018-04-17 16:47:53,172 INFO tuned.profiles.loader: loading profile: balanced 2018-04-17 16:47:53,184 INFO tuned.plugins.plugin_bootloader: installing additional boot command line parameters to grub2 2018-04-17 16:47:53,184 DEBUG tuned.plugins.plugin_bootloader: patching grub.cfg 2018-04-17 16:47:53,184 ERROR tuned.plugins.plugin_bootloader: cannot find grub.cfg to patch, you need to regenerate it by hand by grub2-mkconfig 2018-04-17 16:47:53,266 INFO tuned.plugins.plugin_sysctl: reapplying system sysctl 2018-04-17 16:47:53,270 INFO tuned.plugins.plugin_script: calling script '/etc/tuned/vde-performance/cpu_tweaks.sh' with arguments '['start']' 2018-04-17 16:47:53,353 ERROR tuned.utils.commands: Error when reading file '/sys/class/drm/card0/device/power_method': '[Errno 2] No such file or directory: u'/sys/class/drm/card0/device/power_method'' 2018-04-17 16:47:53,355 INFO tuned.daemon.daemon: static tuning from profile 'balanced' applied Can you confirm that PR 96 will prevent the script from the previous profile from executing again with a "start" parameter when grub2.cfg doesn't exist? In addition to the above question regarding if PR 96 will fix the re-execution of the script with the start parameter... I did some more looking because I noticed the added log message in PR 96 is already present in the output of the grep command in my previous post. I looked at the plugin_bootloader.py on git and I see it present on line 158: https://github.com/olysonek/tuned/blob/dce9ad294149617f8dabd126c4a36e6015ca809e/tuned/plugins/plugin_bootloader.py#L158 (In reply to Aaron from comment #4) > Can you confirm that PR 96 will prevent the script from the previous profile > from executing again with a "start" parameter when grub2.cfg doesn't exist? Yes, it prevents that problem. The problem was that an exception was raised when the file grub2.cfg didn't exist, the exception was not handled, and as a result of that the profile was not properly cleaned up in memory. The patch prevents raising the exception in the first place. Anyway, I created another patch to make the whole process more robust and avoid similar problems: https://github.com/redhat-performance/tuned/pull/97 (In reply to Aaron from comment #5) > I did some more looking because I noticed the added log message in PR 96 is > already present in the output of the grep command in my previous post. I > looked at the plugin_bootloader.py on git and I see it present on line 158: > https://github.com/olysonek/tuned/blob/ > dce9ad294149617f8dabd126c4a36e6015ca809e/tuned/plugins/plugin_bootloader. > py#L158 That is on a different code path. The code you're referring to is not reached when unapplying the tuning. We may want to refactor the code so that the check is done in one place, but this is not a priority at the moment. 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-2018:3172 |