Bug 832815 - irqbalance does not honor affinity_hint values from drivers loaded after it starts
irqbalance does not honor affinity_hint values from drivers loaded after it s...
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: irqbalance (Show other bugs)
16
Unspecified Unspecified
unspecified Severity medium
: ---
: ---
Assigned To: Petr Holasek
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-06-17 11:29 EDT by Andrew J. Schorr
Modified: 2016-10-04 00:08 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-09-17 19:55:04 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Patch the irqbalance.service to start after network.target so network driver affinity_hint values will be honored. (419 bytes, application/octet-stream)
2012-06-17 11:29 EDT, Andrew J. Schorr
no flags Details

  None (edit)
Description Andrew J. Schorr 2012-06-17 11:29:51 EDT
Created attachment 592442 [details]
Patch the irqbalance.service to start after network.target so network driver affinity_hint values will be honored.

Description of problem: irqbalance should honor affinity_hint values set by various drivers.  Since it reads the affinity_hint values only once at startup (unless there's a cpu hotplug event), it is important that irqbalance start after the drivers have been loaded.  The irqbalance.service file says "After=syslog.target"; as a result, irqbalance may start before drivers have had a chance to call irq_set_affinity_hint.  For network drivers, this problem can be solved by adding After=network.target.


Version-Release number of selected component (if applicable): irqbalance-1.0.3-3.fc16.x86_64



How reproducible: Boot up the system.  If irqbalance starts too early, the /proc/irq/*/smp_affinity values will not be consistent with the /proc/irq/*/affinity_hint values.


Steps to Reproduce:
1. Configure the system with a driver that sets affinity_hint values.
2. Reboot the system.
3. Observer that the /proc/irq/*/smp_affinity values may not be consistent with the /proc/irq/*/affinity_hint values.
  
Actual results: /proc/irq/*/smp_affinity ignores the values in affinity_hint if irqbalance happens to start before the driver.


Expected results: /proc/irq/*/smp_affinity values should be consistent with the affinity_hint values.


Additional info: The attached patch seems to fix the problem for network drivers.
Comment 1 Petr Holasek 2012-06-27 09:45:24 EDT
Hello,

I've escalated this issue upstream:

http://code.google.com/p/irqbalance/issues/detail?id=32

Could you please test patch posted by Neil?

thanks,
Petr H
Comment 2 Andrew J. Schorr 2012-07-02 17:09:58 EDT
Hi,

This patch did not work for me.  While this solution seems more elegant in 
principle, I think there's a race condition that is causing it to fail.  Perhaps the irq is being instantiated and triggering a rescan before the driver gets a chance to set the affinity_hint.

Regards,
Andy
Comment 3 Neil Horman 2012-07-12 11:24:26 EDT
The rescan will have a minimum period of 10 seconds, while the time between registering an irq and settings its affinity hint will be measured in microseconds.  So if you're getting a consistent failure of this patch, then I think something else is going on.  Can you tell me:

1) What the affinity_hint of the irq in question is
2) What irqbalance sets that irqs smp_affinity to
3) What the irqbalance daemons hintpolicy is
Comment 4 Petr Holasek 2012-08-17 07:04:46 EDT
Andrew, any news?
Comment 5 Fedora Update System 2012-08-23 10:12:53 EDT
irqbalance-1.0.3-6.fc18 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/irqbalance-1.0.3-6.fc18
Comment 6 Fedora Update System 2012-08-23 11:38:19 EDT
Package irqbalance-1.0.3-6.fc18:
* should fix your issue,
* was pushed to the Fedora 18 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing irqbalance-1.0.3-6.fc18'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2012-12570/irqbalance-1.0.3-6.fc18
then log in and leave karma (feedback).
Comment 7 Fedora Update System 2012-08-29 11:07:22 EDT
irqbalance-1.0.3-7.fc18 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/irqbalance-1.0.3-7.fc18
Comment 8 Fedora Update System 2012-08-29 11:19:15 EDT
irqbalance-1.0.3-6.fc17 has been submitted as an update for Fedora 17.
https://admin.fedoraproject.org/updates/irqbalance-1.0.3-6.fc17
Comment 9 Fedora Update System 2012-09-03 07:27:05 EDT
irqbalance-1.0.3-8.fc18 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/irqbalance-1.0.3-8.fc18
Comment 10 Fedora Update System 2012-09-17 19:55:04 EDT
irqbalance-1.0.3-8.fc18 has been pushed to the Fedora 18 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 11 Fedora Update System 2012-09-18 23:00:07 EDT
irqbalance-1.0.3-6.fc17 has been pushed to the Fedora 17 stable repository.  If problems still persist, please make note of it in this bug report.

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