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.

Bug 1676962

Summary: tuned realtime-virtual-host profile ktimersoftd priority back to default value after reboot
Product: Red Hat Enterprise Linux 8 Reporter: Juri Lelli <jlelli>
Component: tunedAssignee: Jaroslav Škarvada <jskarvad>
Status: CLOSED DUPLICATE QA Contact: qe-baseos-daemons
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 8.1CC: jeder, jlelli, jskarvad, lcapitulino, olysonek, pezhang
Target Milestone: rc   
Target Release: 8.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-02-19 14:44:55 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: 1640832    

Description Juri Lelli 2019-02-13 17:06:54 UTC
Description of problem:
realtime-virtual-host tuned profile (among other things) sets priority of
ktimersoftd threads to 3 (kernel default is 1).

After a reboot however the priority of such threads is back to 1.

Version-Release number of selected component (if applicable):
2.10.0-14.el8

How reproducible:
Always after reboot.

Steps to Reproduce:
1. Apply realtime-virtual-host profile

   # tuned-adm profile realtime-virtual-host

2. Check that priority of ktimersoftd is 3, e.g.
   # pgrep ktimersoftd
   11
   ...

   # chrt -p 11
   pid 11's current scheduling policy: SCHED_FIFO
   pid 11's current scheduling priority: 3

3. Reboot

4. Check again as in step 2. (pids might have changed)

Actual results:
ktimersoftd(s) priority is back at 1

Expected results:
ktimersoftd(s) priority is still 3


Additional info:
Work around is to apply the profile again after system reached console or
use chrt to change ktimersoftd(s) priorities individually.

Comment 1 Juri Lelli 2019-02-14 08:49:01 UTC
Just noticed that same problem applies to ksoftirqd(s) (and I guess
to all changes related to priority tuning).

After reboot ksoftirqs(s) are back to SCHED_NORMAL, instead of
SCHED_FIFO with priority 2.

Comment 2 Ondřej Lysoněk 2019-02-15 17:10:34 UTC
Hmm, I can't reproduce it as follows in a VM with a fresh base rhel-8 system. Perhaps some race condition is involved. I'll take a look again next week.
1. yum install @nfv
2. configure /etc/tuned/realtime-virtual-guest-variables.conf
3. tuned-adm profile realtime-virtual-guest
4. reboot
5. check priority of ktimersoftd/ksoftirqd
6. repeat 4. and 5. multiple times

Comment 3 Juri Lelli 2019-02-15 17:23:16 UTC
This is happening on the host for me, so it's
realtime-virtual-host profile.

Not sure it would make any difference though.

Anyway, I'll try again on a fresh system next week as well.

Comment 4 Ondřej Lysoněk 2019-02-18 17:24:31 UTC
(In reply to Juri Lelli from comment #3)
> This is happening on the host for me, so it's
> realtime-virtual-host profile.
> 
> Not sure it would make any difference though.

The profiles are virtually identical, so it shouldn't. Nevertheless I tried it with realtime-virtual-host on bare metal and got the same results.

To rule out the obvious possibility, are you sure that tuned is running and the correct profile is applied after reboot? (tuned-adm active). Perhaps tuned crashed or something.

Comment 5 Juri Lelli 2019-02-19 07:32:52 UTC
(In reply to Ondřej Lysoněk from comment #4)
> (In reply to Juri Lelli from comment #3)
> > This is happening on the host for me, so it's
> > realtime-virtual-host profile.
> > 
> > Not sure it would make any difference though.
> 
> The profiles are virtually identical, so it shouldn't. Nevertheless I tried
> it with realtime-virtual-host on bare metal and got the same results.
> 
> To rule out the obvious possibility, are you sure that tuned is running and
> the correct profile is applied after reboot? (tuned-adm active). Perhaps
> tuned crashed or something.

On the system where I noticed the problem I checked again right after reboot
and can confirm realtime-virtual-host is active, but k{timersoft,softirq}d
settings are not correct.

This is what I could get from /var/log/tuned.log (notice units.manager at the
end of the log output).

--->8---
2019-02-19 08:22:10,685 INFO     tuned.daemon.application: dynamic tuning is globally disabled
2019-02-19 08:22:10,720 INFO     tuned.daemon.daemon: using sleep interval of 1 second(s)
2019-02-19 08:22:10,724 INFO     tuned.profiles.loader: loading profile: realtime-virtual-host
2019-02-19 08:22:10,745 INFO     tuned.daemon.controller: starting controller
2019-02-19 08:22:10,745 INFO     tuned.daemon.daemon: starting tuning
2019-02-19 08:22:10,771 INFO     tuned.plugins.base: instance cpu: assigning devices cpu11, cpu4, cpu0, cpu7, cpu1, cpu10, cpu2, cpu6, cpu9, cpu8, cpu5, cpu3
2019-02-19 08:22:10,848 INFO     tuned.plugins.plugin_cpu: energy_perf_bias successfully set to 'performance' on cpu 'cpu11'
2019-02-19 08:22:10,896 INFO     tuned.plugins.plugin_cpu: energy_perf_bias successfully set to 'performance' on cpu 'cpu4'
2019-02-19 08:22:10,934 INFO     tuned.plugins.plugin_cpu: energy_perf_bias successfully set to 'performance' on cpu 'cpu0'
2019-02-19 08:22:10,974 INFO     tuned.plugins.plugin_cpu: energy_perf_bias successfully set to 'performance' on cpu 'cpu7'
2019-02-19 08:22:10,998 INFO     tuned.plugins.plugin_cpu: energy_perf_bias successfully set to 'performance' on cpu 'cpu1'
2019-02-19 08:22:11,015 INFO     tuned.plugins.plugin_cpu: energy_perf_bias successfully set to 'performance' on cpu 'cpu10'
2019-02-19 08:22:11,031 INFO     tuned.plugins.plugin_cpu: energy_perf_bias successfully set to 'performance' on cpu 'cpu2'
2019-02-19 08:22:11,050 INFO     tuned.plugins.plugin_cpu: energy_perf_bias successfully set to 'performance' on cpu 'cpu6'
2019-02-19 08:22:11,080 INFO     tuned.plugins.plugin_cpu: energy_perf_bias successfully set to 'performance' on cpu 'cpu9'
2019-02-19 08:22:11,128 INFO     tuned.plugins.plugin_cpu: energy_perf_bias successfully set to 'performance' on cpu 'cpu8'
2019-02-19 08:22:11,168 INFO     tuned.plugins.plugin_cpu: energy_perf_bias successfully set to 'performance' on cpu 'cpu5'
2019-02-19 08:22:11,242 INFO     tuned.plugins.plugin_cpu: energy_perf_bias successfully set to 'performance' on cpu 'cpu3'
2019-02-19 08:22:11,242 INFO     tuned.plugins.plugin_cpu: setting new cpu latency 1
2019-02-19 08:22:11,475 ERROR    tuned.utils.commands: Executing sysctl error: sysctl: cannot stat /proc/sys/net/core/busy_read: No such file or directory
2019-02-19 08:22:11,494 ERROR    tuned.utils.commands: Executing sysctl error: sysctl: cannot stat /proc/sys/net/core/busy_poll: No such file or directory
2019-02-19 08:22:11,531 ERROR    tuned.utils.commands: Executing sysctl error: sysctl: cannot stat /proc/sys/kernel/numa_balancing: No such file or directory
2019-02-19 08:22:11,630 INFO     tuned.plugins.plugin_sysctl: reapplying system sysctl
2019-02-19 08:22:11,641 WARNING  tuned.plugins.plugin_vm: Option 'transparent_hugepages' is not supported on current hardware.
2019-02-19 08:22:11,643 INFO     tuned.plugins.plugin_bootloader: installing additional boot command line parameters to grub2
2019-02-19 08:22:11,784 INFO     tuned.plugins.plugin_script: calling script '/usr/lib/tuned/realtime/script.sh' with arguments '['start']'
2019-02-19 08:22:11,828 INFO     tuned.plugins.plugin_script: calling script '/usr/lib/tuned/realtime-virtual-host/script.sh' with arguments '['start']'
2019-02-19 08:22:12,021 ERROR    tuned.units.manager: BUG: Unhandled exception in start_tuning: dictionary changed size during iteration
2019-02-19 08:22:12,021 INFO     tuned.daemon.daemon: static tuning from profile 'realtime-virtual-host' applied
--->8---

Having said this, I'm also not able to reproduce the same on another fresh box from Beaker.
Might be related to specific system config or series of actions (the one that shows the
problem I used for some time to work on a BZ, so several kernels have been installed/removed
and quite some tuning happened as well..)?

Please let me know if I could provide more debug info from the box I'm using.

Comment 6 Ondřej Lysoněk 2019-02-19 09:53:17 UTC
Thanks for the log, that helped. I think you've hit bug#1669294. Can you please upgrade python3-linux-procfs on the machine and test it again?

Comment 7 Juri Lelli 2019-02-19 14:32:56 UTC
(In reply to Ondřej Lysoněk from comment #6)
> Thanks for the log, that helped. I think you've hit bug#1669294. Can you
> please upgrade python3-linux-procfs on the machine and test it again?

Ah, indeed! Upgrading python3-linux-procfs fixed the problem.

Thanks a lot.

Comment 8 Luiz Capitulino 2019-02-19 14:44:15 UTC
Can we then close this one as dupe of bug 1669294?

Comment 9 Ondřej Lysoněk 2019-02-19 14:44:55 UTC

*** This bug has been marked as a duplicate of bug 1669294 ***