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 2063930

Summary: [PATCH] Confine irqbalance to systems where it can do something useful
Product: Red Hat Enterprise Linux 9 Reporter: Pat Riehecky <riehecky>
Component: irqbalanceAssignee: ltao
Status: CLOSED ERRATA QA Contact: Jiri Dluhos <jdluhos>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: CentOS StreamCC: bstinson, extras-qa, jeder, jshortt, jwboyer, ltao, nhorman, ruyang, rvr, walters
Target Milestone: rcKeywords: Triaged
Target Release: ---Flags: pm-rhel: mirror+
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: irqbalance-1.8.0-5.el9 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 2063926 Environment:
Last Closed: 2022-11-15 11:18:28 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:

Description Pat Riehecky 2022-03-14 16:25:24 UTC
+++ This bug was initially created as a clone of Bug #2063926 +++

Description of problem:

IRQBalance can be started on systems without multiple CPUs.  This means there is no work for it to do, but it will consume CPU/Memory

Version-Release number of selected component (if applicable):
irqbalance-1.7.0-8.fc35.x86_64

How reproducible:
100%

Steps to Reproduce:
1.Fire up a VM with 1 CPU
2.Start irqbalance service
3.Note it starts

Actual results:
Starts useless irqbalance service

Expected results:
smart enough to not do this

Additional info:

--- Additional comment from Pat Riehecky on 2022-03-14 16:24:11 UTC ---

Comment 2 Jiri Dluhos 2022-05-27 13:33:17 UTC
Confirming the fix, as described in patch http://pkgs.devel.redhat.com/cgit/rpms/irqbalance/commit/?h=rhel-9-main&id=3c91db6799b96664c6b402522562ebbe67fa27eb

# rpm -q irqbalance
irqbalance-1.8.0-5.el9.x86_64

# less /usr/lib/systemd/system/irqbalance.service | grep 'CPUs'
ConditionCPUs=>1

So far, so good; but when I tried on a virtual machine with a single CPU with the _old_ irqbalance, it did not start, saying this:

# rpm -q irqbalance
irqbalance-1.8.0-4.el9.x86_64

# systemctl start irqbalance
# systemctl status irqbalance
○ irqbalance.service - irqbalance daemon
     Loaded: loaded (/usr/lib/systemd/system/irqbalance.service; enabled; vendor preset: enabled)
     Active: inactive (dead) since Fri 2022-05-27 15:30:01 CEST; 7s ago
   Duration: 22ms
       Docs: man:irqbalance(1)
             https://github.com/Irqbalance/irqbalance
    Process: 17741 ExecStart=/usr/sbin/irqbalance --foreground $IRQBALANCE_ARGS (code=exited, status=0/SUCCESS)
   Main PID: 17741 (code=exited, status=0/SUCCESS)
        CPU: 12ms

May 27 15:30:01 kvm-01-guest01.lab.eng.brq.redhat.com systemd[1]: Started irqbalance daemon.
May 27 15:30:01 kvm-01-guest01.lab.eng.brq.redhat.com /usr/sbin/irqbalance[17741]: Balancing is ineffective on systems with a single cpu.  Shutting down
May 27 15:30:01 kvm-01-guest01.lab.eng.brq.redhat.com systemd[1]: irqbalance.service: Deactivated successfully.

So, it seems it has some kind of awareness of this problem by itself; aren't we double-patching a single problem here?

Comment 3 Jiri Dluhos 2022-05-27 13:52:57 UTC
Otherwise, I can confirm that the patch works, and with it, systemd does not even try to load irqbalance if there is only a single CPU, as planned:

# rpm -q irqbalance
irqbalance-1.8.0-5.el9.x86_64

# systemctl start irqbalance
# systemctl status irqbalance
May 27 15:50:13 kvm-01-guest01.lab.eng.brq.redhat.com systemd[1]: irqbalance daemon was skipped because of a failed condition check (ConditionCPUs=>1).

So everything is OK and I am ready to stamp VERIFIED when confirmed that we want to doubly handle this situation.

Comment 4 ltao 2022-05-30 06:29:24 UTC
(In reply to Jiri Dluhos from comment #2)
> Confirming the fix, as described in patch
> http://pkgs.devel.redhat.com/cgit/rpms/irqbalance/commit/?h=rhel-9-
> main&id=3c91db6799b96664c6b402522562ebbe67fa27eb
> 
> # rpm -q irqbalance
> irqbalance-1.8.0-5.el9.x86_64
> 
> # less /usr/lib/systemd/system/irqbalance.service | grep 'CPUs'
> ConditionCPUs=>1
> 
> So far, so good; but when I tried on a virtual machine with a single CPU
> with the _old_ irqbalance, it did not start, saying this:
> 
> # rpm -q irqbalance
> irqbalance-1.8.0-4.el9.x86_64
> 
> # systemctl start irqbalance
> # systemctl status irqbalance
> ○ irqbalance.service - irqbalance daemon
>      Loaded: loaded (/usr/lib/systemd/system/irqbalance.service; enabled;
> vendor preset: enabled)
>      Active: inactive (dead) since Fri 2022-05-27 15:30:01 CEST; 7s ago
>    Duration: 22ms
>        Docs: man:irqbalance(1)
>              https://github.com/Irqbalance/irqbalance
>     Process: 17741 ExecStart=/usr/sbin/irqbalance --foreground
> $IRQBALANCE_ARGS (code=exited, status=0/SUCCESS)
>    Main PID: 17741 (code=exited, status=0/SUCCESS)
>         CPU: 12ms
> 
> May 27 15:30:01 kvm-01-guest01.lab.eng.brq.redhat.com systemd[1]: Started
> irqbalance daemon.
> May 27 15:30:01 kvm-01-guest01.lab.eng.brq.redhat.com
> /usr/sbin/irqbalance[17741]: Balancing is ineffective on systems with a
> single cpu.  Shutting down
> May 27 15:30:01 kvm-01-guest01.lab.eng.brq.redhat.com systemd[1]:
> irqbalance.service: Deactivated successfully.
> 
> So, it seems it has some kind of awareness of this problem by itself; aren't
> we double-patching a single problem here?

Hi Jiri,

Thanks for reporting this, I think it is the same issue addressed in upstream [1].
Irqbalance do has the check in it's main function, which will fail due to one cpu, but it doesn't stop systemd from trying to start the service, which is a waste of effort. So this patch simply stop systemd from starting the service when cpu_num=1.

Thanks,
Tao Liu


[1]: https://github.com/Irqbalance/irqbalance/pull/201

Comment 5 ltao 2022-05-30 06:31:33 UTC
(In reply to Jiri Dluhos from comment #3)
> Otherwise, I can confirm that the patch works, and with it, systemd does not
> even try to load irqbalance if there is only a single CPU, as planned:
> 
> # rpm -q irqbalance
> irqbalance-1.8.0-5.el9.x86_64
> 
> # systemctl start irqbalance
> # systemctl status irqbalance
> May 27 15:50:13 kvm-01-guest01.lab.eng.brq.redhat.com systemd[1]: irqbalance
> daemon was skipped because of a failed condition check (ConditionCPUs=>1).
> 
> So everything is OK and I am ready to stamp VERIFIED when confirmed that we
> want to doubly handle this situation.

Yes, looks good to me.

Thanks,
Tao Liu

Comment 6 Jiri Dluhos 2022-05-30 16:59:36 UTC
Agreed; setting VERIFIED.

Comment 9 errata-xmlrpc 2022-11-15 11:18:28 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 (irqbalance 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-2022:8328