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 2117327

Summary: Examine how to change rteval to automatically make use of isolcpus
Product: Red Hat Enterprise Linux 8 Reporter: John Kacur <jkacur>
Component: rtevalAssignee: Tomas Glozar <tglozar>
Status: CLOSED MIGRATED QA Contact: Waylon Cude <wcude>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 8.8CC: bhu, crwood, jlelli, mstowell, qzhao, rt-maint, tglozar
Target Milestone: rcKeywords: MigratedToJIRA, Triaged
Target Release: ---Flags: pm-rhel: mirror+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 2117328 (view as bug list) Environment:
Last Closed: 2023-09-25 17:07:17 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: 2117328    

Description John Kacur 2022-08-10 16:07:39 UTC
Description of problem:
Currently rteval is not taking isolated cpus into account.
Make sure that this isn't causing any problems regarding calculations

Comment 1 Tomas Glozar 2023-06-13 09:05:18 UTC
After doing some investigation I found 4 issues with rteval and isolcpus:

- cyclictest excludes isolated CPUs by default, since it excludes cores that are not included in the CPU affinity mask of its process, unless -a is used with a CPU list argument (passed by rteval's --measurement-cpulist). This does not reflect the typical use case of isolated CPUs being used for critical tasks here represented by cyclictest.
- loads use the number of online CPUs, including isolated CPUs, to compute the load size (e.g. number of make jobs for kcompile), while they do not get scheduled on isolated CPUs by default. This is the wanted behavior, since they represent non-critical tasks, but the load might be too high.
- loads do not execute properly on isolated CPUs when specifying multiple CPUs in --loads-cpulist. This is caused by the behavior of the scheduler, which won't migrate threads either from, to, or among isolated CPUs (see https://access.redhat.com/solutions/480473); therefore for the loads to execute properly, their tasks would have to be bound to a single CPU per thread in this case (cyclictest already does this).
- reports mention loads and measurements being run on all CPUs including isolated ones even in the default case where the process CPU affinity mask (excluding isolated CPUs) is used. This can cause misleading results, since it reports the same number of CPUs as when --loads-cpulist and --measurement-cpulist is used to specify all CPUs (in which case the isolated CPUs *are* used).

None of these are RHEL-specific and all can be resolved upstream. Possible fixes:

- default to all CPUs including isolated ones for cyclictest measurement, i.e. pass `-a 0-<ncpus>` to it by default instead of just `-a`.
- exclude isolated CPUs from load size calculations.
- when including isolated CPUs in --loads-cpulist, pick jobs to bind specifically to individual isolated CPUs from the set.
- report isolated CPUs properly, including information on if they are used or not by the current run on rteval.

Comment 2 John Kacur 2023-06-19 23:38:46 UTC
(In reply to Tomáš Glozar from comment #1)
> After doing some investigation I found 4 issues with rteval and isolcpus:
> 
> - cyclictest excludes isolated CPUs by default, since it excludes cores that
> are not included in the CPU affinity mask of its process, unless -a is used
> with a CPU list argument (passed by rteval's --measurement-cpulist). This
> does not reflect the typical use case of isolated CPUs being used for
> critical tasks here represented by cyclictest.

I think this is okay, the default should be to not run on an isolated cpu unless the
user explicitly asks to do so.

> - loads use the number of online CPUs, including isolated CPUs, to compute
> the load size (e.g. number of make jobs for kcompile), while they do not get
> scheduled on isolated CPUs by default. This is the wanted behavior, since
> they represent non-critical tasks, but the load might be too high.

That's a good point.

> - loads do not execute properly on isolated CPUs when specifying multiple
> CPUs in --loads-cpulist. This is caused by the behavior of the scheduler,
> which won't migrate threads either from, to, or among isolated CPUs (see
> https://access.redhat.com/solutions/480473); therefore for the loads to
> execute properly, their tasks would have to be bound to a single CPU per
> thread in this case (cyclictest already does this).
> - reports mention loads and measurements being run on all CPUs including
> isolated ones even in the default case where the process CPU affinity mask
> (excluding isolated CPUs) is used. This can cause misleading results, since
> it reports the same number of CPUs as when --loads-cpulist and
> --measurement-cpulist is used to specify all CPUs (in which case the
> isolated CPUs *are* used).
> 
> None of these are RHEL-specific and all can be resolved upstream. Possible
> fixes:

Right, this is the standard way in which we work anyway, you have to push
a fix upstream before you are allowed to put it in RHEL
> 
> - default to all CPUs including isolated ones for cyclictest measurement,
> i.e. pass `-a 0-<ncpus>` to it by default instead of just `-a`.
> - exclude isolated CPUs from load size calculations.
> - when including isolated CPUs in --loads-cpulist, pick jobs to bind
> specifically to individual isolated CPUs from the set.
> - report isolated CPUs properly, including information on if they are used
> or not by the current run on rteval.

Okay, please discuss approaches with me offline before implementing anything, thanks.

Comment 3 RHEL Program Management 2023-09-25 16:58:40 UTC
Issue migration from Bugzilla to Jira is in process at this time. This will be the last message in Jira copied from the Bugzilla bug.

Comment 4 RHEL Program Management 2023-09-25 17:07:17 UTC
This BZ has been automatically migrated to the issues.redhat.com Red Hat Issue Tracker. All future work related to this report will be managed there.

Due to differences in account names between systems, some fields were not replicated.  Be sure to add yourself to Jira issue's "Watchers" field to continue receiving updates and add others to the "Need Info From" field to continue requesting information.

To find the migrated issue, look in the "Links" section for a direct link to the new issue location. The issue key will have an icon of 2 footprints next to it, and begin with "RHEL-" followed by an integer.  You can also find this issue by visiting https://issues.redhat.com/issues/?jql= and searching the "Bugzilla Bug" field for this BZ's number, e.g. a search like:

"Bugzilla Bug" = 1234567

In the event you have trouble locating or viewing this issue, you can file an issue by sending mail to rh-issues. You can also visit https://access.redhat.com/articles/7032570 for general account information.