Bug 832815

Summary: irqbalance does not honor affinity_hint values from drivers loaded after it starts
Product: [Fedora] Fedora Reporter: Andrew J. Schorr <aschorr>
Component: irqbalanceAssignee: Petr Holasek <pholasek>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 16CC: anton, dhoward, nhorman, pholasek
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-09-17 23:55:04 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:
Attachments:
Description Flags
Patch the irqbalance.service to start after network.target so network driver affinity_hint values will be honored. none

Description Andrew J. Schorr 2012-06-17 15:29:51 UTC
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 13:45:24 UTC
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 21:09:58 UTC
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 15:24:26 UTC
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 11:04:46 UTC
Andrew, any news?

Comment 5 Fedora Update System 2012-08-23 14:12:53 UTC
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 15:38:19 UTC
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 15:07:22 UTC
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 15:19:15 UTC
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 11:27:05 UTC
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 23:55:04 UTC
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-19 03:00:07 UTC
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.