Bug 1797629

Summary: Disable timer_migration on cpu-partitioning profile
Product: Red Hat Enterprise Linux 8 Reporter: Andrew Theurer <atheurer>
Component: tunedAssignee: Jaroslav Škarvada <jskarvad>
Status: CLOSED ERRATA QA Contact: Robin Hack <rhack>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 8.3CC: atheurer, bmichalo, cfontain, fiezzi, jeder, jskarvad, lcapitulino, rhack, williams
Target Milestone: rcKeywords: Patch, Triaged, Upstream
Target Release: 8.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: tuned-2.14.0-0.1.rc1.el8 Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-11-04 02:03:07 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: 1810050, 1817044, 1825061    

Description Andrew Theurer 2020-02-03 14:19:45 UTC
Description of problem:

Timer migration enabled migrates timer work to CPUs which should be minimally interrupted.


Version-Release number of selected component (if applicable):


How reproducible: Easily


Steps to Reproduce:
1. reboot with cpu-partitioning
2. run something like sysjitter to characterize latency
3. collect ftrace if necessary to see timer work on nohz_full CPUs.

Actual results:
Higher spikes in latency because of extra timer work on CPUs


Expected results:
Lower spikes in latency because of no extra timer work on CPUs


Additional info:

The original motivation for enabling timers was:

"As the cpu-partitioning profile does not use isolcpus=,
the kernel can end up creating long living timers on
nohz_full CPUs during early boot. Those timers will
fire later, causing jitter.

However, recent Linux kernel will always try to migrate
unpinned timers away from nohz_full CPUs when timer
migration is enabled which is what we want."


To deal with log lived timers, the cpu-partitioning profile now modifies the kernel workqueue early in the boot, before drivers are started, so long lived timers are not set on the isolated CPUs.  So the original motivation to enable timer_migration should not exist.

Also, I am not sure the actual behavior of timer_migration is what's described as above in the quotation.  The timer_migration should be moving timers from idle CPUs to active CPUs, and that might include active CPUs with nohz_full.  It would help to clarify exactly how this feature works with both RHEL8 and RHEL7 kernels.

Finally, timer_migration is disabled in the realtime tuned profiles, and we want the same timer behavior in both the cpu-partitioning and the realtime profiles.

Comment 3 Ondřej Lysoněk 2020-02-26 16:46:59 UTC
Hi Andrew,

can you please confirm that this is the change you want us to make?
https://github.com/redhat-performance/tuned/pull/250

Comment 4 Andrew Theurer 2020-02-26 20:13:40 UTC
(In reply to Ondřej Lysoněk from comment #3)
> Hi Andrew,
> 
> can you please confirm that this is the change you want us to make?
> https://github.com/redhat-performance/tuned/pull/250

Yes, this is what we need, thanks!

Comment 8 Jaroslav Škarvada 2020-04-29 15:09:17 UTC
Andrew, there is bug 1779719 requesting the opposite for the realtime profiles. So do you want the timer migration to be disabled in realtime and cpu-partitining profiles? Or enabled in realtime profiles and disabled in the cpu-partitining? Could you elaborate?

Comment 9 Andrew Theurer 2020-04-30 15:31:10 UTC
Discussed with Luiz, the other BZ will be closed; we don't want timer_migration enabled even in realtime virt profiles.  And so we still want to disable migration in cpu-partitioning

Comment 10 Luiz Capitulino 2020-04-30 15:55:18 UTC
(In reply to Jaroslav Škarvada from comment #8)
> Andrew, there is bug 1779719 requesting the opposite for the realtime
> profiles. So do you want the timer migration to be disabled in realtime and
> cpu-partitining profiles? Or enabled in realtime profiles and disabled in
> the cpu-partitining? Could you elaborate?

Very good catch Jaroslav!

We discussed this on a meeting today, the conclusion is to disable it in
all profiles. In detail we want:

1. Disable it in the cpu-partition profile (this BZ)
2. Keep it disabled in the real-time profiles (I'll follow up in bug 1779719)

The reason being, having timer_migration enabled causes timers to be
migrated to busy CPUs, which is going to be the CPUs running DPDK threads.
This in turn will cause interruptions to DPDK threads.

Comment 17 errata-xmlrpc 2020-11-04 02:03:07 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-2020:4559