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 1472840 - File "/usr/lib/python2.7/site-packages/tuna/tuna.py", line 366, in isolate_cpus
Summary: File "/usr/lib/python2.7/site-packages/tuna/tuna.py", line 366, in isolate_cpus
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: tuna
Version: 7.5
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: John Kacur
QA Contact: Jiri Kastner
URL:
Whiteboard:
: 1455478 (view as bug list)
Depends On:
Blocks: kvm-rt-tuned 1442258
TreeView+ depends on / blocked
 
Reported: 2017-07-19 13:53 UTC by Luiz Capitulino
Modified: 2018-04-10 18:13 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-04-10 18:13:39 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Use errno codes instead of raw numbers (11.29 KB, patch)
2017-09-13 10:49 UTC, John Kacur
no flags Details | Diff
exit isolate_cpus with an error msg instead of a traceback (2.68 KB, patch)
2017-09-13 10:50 UTC, John Kacur
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2018:0967 0 None None None 2018-04-10 18:13:49 UTC

Description Luiz Capitulino 2017-07-19 13:53:27 UTC
Description of problem:

We call tuna from tuned's realtime-virtual-host profile like this:

tuna -c "$TUNED_isolated_cores" -i

From time to time when booting the system, I'm getting the following error (from tuned logs):

2017-07-19 09:16:56,898 ERROR    tuned.plugins.plugin_script: script '/usr/lib/tuned/realtime/script.sh' error: 1, 'Traceback (most recent call last):
  File "/usr/bin/tuna", line 710, in <module>
    main()
  File "/usr/bin/tuna", line 546, in main
    tuna.isolate_cpus(cpu_list, get_nr_cpus())
  File "/usr/lib/python2.7/site-packages/tuna/tuna.py", line 366, in isolate_cpus
    raise e
OSError: [Errno 22] Invalid argument'

When this happens the profile is only half applied, which causes KVM-RT to become unfunctional.

NOTE: It is the first time I see this, so either: this is a recent issue or this system makes it more likely to happen.

Version-Release number of selected component (if applicable): tuna-0.13-5.el7.noarch, tuned-2.8.0-5.el7.noarch


How reproducible:


Steps to Reproduce:
1. Setup the realtime-virtual-host profile
2. Boot the system a few times

Comment 2 Luiz Capitulino 2017-07-19 14:00:26 UTC
Jaroslav,

While debugging this, I realized that it's the realtime profile that's calling tuna. However, the realtime-virtual-host profile also calls tuna with the same command-line. While I guess that calling tuna twice is not the cause of this issue, should we remove tuna invocation from the realtime-virtual-{host,guest} profiles?

Comment 3 John Kacur 2017-07-19 14:32:56 UTC
(In reply to Luiz Capitulino from comment #2)
> Jaroslav,
> 
> While debugging this, I realized that it's the realtime profile that's
> calling tuna. However, the realtime-virtual-host profile also calls tuna
> with the same command-line. While I guess that calling tuna twice is not the
> cause of this issue, should we remove tuna invocation from the
> realtime-virtual-{host,guest} profiles?

You mentioned that when this occurs the profile is only partially applied. This is occurring in the guest I assume, not the host? If we can't detect when the profile is fully applied, then I would think removing the call from the guest would solve the problem?

Comment 4 Luiz Capitulino 2017-07-19 14:50:38 UTC
Both calls to tuna happen in the host, the guest is not involved. I guess the profile is half applied because tuna returned an error and maybe tuned stopped short applying the profile. I think the best action for tuned would be to revert what was applied and fail, but that's a entierly different issue/BZ.

For this BZ we probably have to fix tuna.

PS: I'll add the needinfo back because I also need input from Jaroslav regarding comment 2.

Comment 5 Jaroslav Škarvada 2017-07-19 15:59:04 UTC
(In reply to Luiz Capitulino from comment #2)
> Jaroslav,
> 
> While debugging this, I realized that it's the realtime profile that's
> calling tuna. However, the realtime-virtual-host profile also calls tuna
> with the same command-line. While I guess that calling tuna twice is not the
> cause of this issue, should we remove tuna invocation from the
> realtime-virtual-{host,guest} profiles?

Yes, we can remove it. But it seems there are more duplicities. E.g. as a next step we could probably also drop defirqaffinity.py, because it seems it's functionality is already implemented in Tuna. And we could also move to the plugin scheduler which has all the functionality built-in and can also skip processes / associated threads specified by regex. We switched cpu-partitioning to plugin scheduler upstream. Other profiles could be also switched.

Comment 6 Jaroslav Škarvada 2017-07-19 16:36:48 UTC
(In reply to Jaroslav Škarvada from comment #5)
> (In reply to Luiz Capitulino from comment #2)
> > Jaroslav,
> > 
> > While debugging this, I realized that it's the realtime profile that's
> > calling tuna. However, the realtime-virtual-host profile also calls tuna
> > with the same command-line. While I guess that calling tuna twice is not the
> > cause of this issue, should we remove tuna invocation from the
> > realtime-virtual-{host,guest} profiles?
> 
> Yes, we can remove it. But it seems there are more duplicities. E.g. as a
> next step we could probably also drop defirqaffinity.py, because it seems
> it's functionality is already implemented in Tuna. And we could also move to
> the plugin scheduler which has all the functionality built-in and can also
> skip processes / associated threads specified by regex. We switched
> cpu-partitioning to plugin scheduler upstream. Other profiles could be also
> switched.

Upstream commit removing the second invocation of Tuna:
https://github.com/redhat-performance/tuned/commit/962bae3d719d81a7cf52843270d3eb4bd762efce

Comment 7 Luiz Capitulino 2017-07-20 13:09:35 UTC
Thanks Jaroslav!

Comment 8 John Kacur 2017-09-13 10:45:57 UTC
*** Bug 1455478 has been marked as a duplicate of this bug. ***

Comment 10 John Kacur 2017-09-13 10:49:08 UTC
Created attachment 1325309 [details]
Use errno codes instead of raw numbers

Comment 11 John Kacur 2017-09-13 10:50:16 UTC
Created attachment 1325310 [details]
exit isolate_cpus with an error msg instead of a traceback

Comment 19 errata-xmlrpc 2018-04-10 18:13:39 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, 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:0967


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