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 1890219 - Under heavy load tuned [scheduler] plugin can miss processes.
Summary: Under heavy load tuned [scheduler] plugin can miss processes.
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: tuned
Version: 8.3
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: 8.4
Assignee: Jaroslav Škarvada
QA Contact: Robin Hack
URL: https://github.com/redhat-performance...
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-10-21 17:32 UTC by Jiří Mencák
Modified: 2021-05-18 15:06 UTC (History)
4 users (show)

Fixed In Version: tuned-2.15.0-0.1.rc1.el8
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-05-18 15:05:25 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Proposed fix (2.30 KB, patch)
2020-10-21 19:06 UTC, Jaroslav Škarvada
no flags Details | Diff

Description Jiří Mencák 2020-10-21 17:32:22 UTC
Description of problem:
Under heavy load tuned [scheduler] plugin can miss processes to set CPU affinity to.

How reproducible:
Rare but happens.  Seen on OpenShift deployments where multiple pods start at the same time after boot.

I've seen OpenShift deployments with containerized tuned that missed to set CPU affinity to a child process parent of which had the CPU affinity set correctly by tuned.  No self-pinning was performed by the child.

Additional info:
Already discussed this with a tuned maintainer and a possible fix might be adjusting the perf ring buffer size.

A customer BZ that prompted this report: https://bugzilla.redhat.com/show_bug.cgi?id=1889015  I was able to reproduce this independently of the customer.

Comment 1 Jaroslav Škarvada 2020-10-21 17:47:05 UTC
I think the following happens:
- main process is created
- tuned perf hook catches it and starts tuning it
- child process is created, main process tuning is still not finished, so the child cannot inherit the correct affinity
- many other processes are created, perf ring buffer fills up
- perf ring buffer overflows (or more precisely rewrites the child record), so it will be no more tuned by Tuned
- main process tuning finishes and the main process has correct affinity

I think this could be overcome by increasing the perf ring buffer size and by making the buffer size customizable in the Tuned profile.

Unfortunately, at the moment I don't know how to increase the buffer, but I think there is a way in the perf.

Comment 2 Jaroslav Škarvada 2020-10-21 19:06:23 UTC
Created attachment 1723288 [details]
Proposed fix

This is experimental fix adding the 'perf_mmap_pages' scheduler plugin option. This overrides the default kernel value of mmap pages used for the perf ring buffer size. The value has to be power of 2. If it is not the power of 2, Tuned calculates the nearest bigger power of 2 value from it. If this option is not specified, the default kernel value is used, which IMHO for the current kernel is 128.

Example of usage:
[scheduler]
perf_mmap_pages = 256

Comment 6 Jaroslav Škarvada 2020-12-01 16:46:23 UTC
Upstream PR:
https://github.com/redhat-performance/tuned/pull/310

Comment 15 errata-xmlrpc 2021-05-18 15:05:25 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:1671


Note You need to log in before you can comment on or make changes to this bug.