irq count is zero bug

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



I have a problem with irqbalance involving PCI passthrough to a virtual machine.  I don't know that the problem is specific to running a virtual machine, but that is the use case that exposes the problem for me.

When the VM is started the interrupts for the devices are detected in /proc/interrupts and are not known to irqbalance yet, so the policy script gets called and the interrupts get balanced properly.

If the VM does not use the device, the interrupt counts in /proc/interrupts remain at zero.  Then if the VM is shutdown and restarted irqbalance does not detect that the interrupts need to be balanced and does not call the policy script.  The code in procinterrupts.c:parse_proc_interrupts() checks the count that was saved to the current counts in /proc/interrupts, but since the saved count is zero the current count can never be less and need_rescan does not get set.

            /* IRQ removed and reinserted, need restart or this will
             * cause an overflow and IRQ won't be rebalanced again
            if (count < info->irq_count) {
                need_rescan = 1;

I have patches that fix the problem by adding a sequence number to the irq_info structure.  As /proc/interrupts is parsed the sequence number is updated in the irq_info structure for the interrupt.  After the scan, irq_info structures that do not have a current sequence number can be deleted.

If there is a better way to do this, please let me know.  I can test other possible fixes if needed.

Thanks, Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: irqbalance-1.2.0.patch
Type: application/octet-stream
Size: 5074 bytes
Desc: irqbalance-1.2.0.patch
URL: <>

[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux