# Kernel IRQBALANCE not working?

## Jkay

I found out about the **external** IRQbalance ebuild accidentally, and used 

```
cat /proc/interrupts
```

to see if my dual CPU machine was set up properly to make the CPUs share the IRQ load. The kernel option for IRQbalance is enabled, but here is the pathetic response:

```

           CPU0       CPU1

  0:    7120210       1768    IO-APIC-edge  timer

  1:        942          1    IO-APIC-edge  i8042

  8:          1          1    IO-APIC-edge  rtc

  9:          0          0   IO-APIC-level  acpi

 12:     155920        100    IO-APIC-edge  i8042

 14:       3227          2    IO-APIC-edge  ide0

 15:     507138          1    IO-APIC-edge  ide1

 16:      25983         25   IO-APIC-level  ohci_hcd:usb3, eth0

 17:      66593          5   IO-APIC-level  ide2, ehci_hcd:usb1

 18:     118894          3   IO-APIC-level  ohci1394, ohci_hcd:usb4, EMU10K1

 19:    1828505         69   IO-APIC-level  ohci_hcd:usb2

NMI:          0          0

LOC:    7121776    7121783

ERR:          0

MIS:          0

```

So I merged the IRQinterrupt ebuild, and *immediately* the load began to become more even:

```

           CPU0       CPU1

  0:   10100592    2874869    IO-APIC-edge  timer

  1:       5394       5051    IO-APIC-edge  i8042

  8:          1          1    IO-APIC-edge  rtc

  9:          0          0   IO-APIC-level  acpi

 12:     491169     313274    IO-APIC-edge  i8042

 14:       5295       1000    IO-APIC-edge  ide0

 15:     717717     206932    IO-APIC-edge  ide1

 16:     398744         25   IO-APIC-level  ohci_hcd:usb3, eth0

 17:      83480      14961   IO-APIC-level  ide2, ehci_hcd:usb1

 18:     118894          3   IO-APIC-level  ohci1394, ohci_hcd:usb4, EMU10K1

 19:    2572643     737382   IO-APIC-level  ohci_hcd:usb2

NMI:          0          0

LOC:   12975154   12975161

ERR:          0

MIS:          0

```

This would imply that the built-in 2.6.xx multiple CPU IRQ load kernel balancer is broken.

```

 # uname -a

Linux xxx 2.6.16-gentoo-r9 #6 SMP PREEMPT Thu Aug 31 22:41:01 EDT 2006 i686 AMD Athlon(tm) MP 2400+ GNU/Linux
```

Even 6 months ago, people might have said "WHO CARES, only YOU have a multiple CPU machine. You wasted your cash LOL!" But now that both AMD and Intel are going **nuts** making multi-core CPUs the norm instead of a freakshow, this matters to most people.

----------

## cal22cal

For the irqbalance, you don't need to do anything.

Unemerge your irqbalance ebuild.

DON'T SET the kernel irqbalance option.

```

05:03:11 linux # grep -i balance .config

# CONFIG_IRQBALANCE is not set

05:03:21 linux # cat  /proc/interrupts

           CPU0       CPU1

  0:     571629     569545    IO-APIC-edge  timer

  1:       2699       2713    IO-APIC-edge  i8042

  2:          0          0          XT-PIC  cascade

  5:     324937     325321   IO-APIC-level  nvidia

  7:     108823     107844   IO-APIC-level  CMI8738, eth0

  8:          2          0    IO-APIC-edge  rtc

  9:          0          0    IO-APIC-edge  acpi

 10:      43143      43170   IO-APIC-level  aic7xxx

 11:       9469       9237   IO-APIC-level  eth1

 12:      90809      91177    IO-APIC-edge  i8042

 14:      21846      21686    IO-APIC-edge  ide0

NMI:          0          0

LOC:    1141077    1141078

ERR:          0

MIS:          0

```

----------

## Jkay

Hmm!! That's an odd solution .. turn it all off to turn it on?   :Shocked: 

----------

## moesasji

```

hge@pulsar /usr/src/linux $ grep -i balance .config

CONFIG_IRQBALANCE=y

hge@pulsar /usr/src/linux $ cat /proc/interrupts

           CPU0       CPU1

  0:  597147568          0    IO-APIC-edge  timer

  8:          2          0    IO-APIC-edge  rtc

  9:          0          0   IO-APIC-level  acpi

 14:       2778          0    IO-APIC-edge  ide0

 15:     374054          0    IO-APIC-edge  ide1

 16:   54670461          0   IO-APIC-level  nvidia

 17:   20488896          0   IO-APIC-level  libata, EMU10K1

 18:       4516          0   IO-APIC-level  libata

 19:     869457          0   IO-APIC-level  ehci_hcd:usb1

 20:    1822768          0   IO-APIC-level  ohci_hcd:usb2

 21:      52947          0   IO-APIC-level  ohci_hcd:usb3

 22:          0          0   IO-APIC-level  ohci_hcd:usb4

 23:   30245789          0   IO-APIC-level  skge

NMI:          0          0

LOC:  597178244  597179381

ERR:         12

MIS:          0

```

This is indeed strange. I do have the IRQ-balance set in the kernel-config.

However in my case it seems that it is not working as it should as can be seen above.

That would indicate that it should be set to NO   :Question: 

----------

## Jkay

With the kernel option ON and the irqbalance ebuild installed, everything is perfectly balanced now. That's not the way it's supposed to work tho. You aren't supposed to NEED the ebuild if you are running a 2.6 kernel with the option on.

```

# cat /proc/interrupts

           CPU0       CPU1

  0:    5369009    5294334    IO-APIC-edge  timer

  1:       1516       1202    IO-APIC-edge  i8042

  8:          2          0    IO-APIC-edge  rtc

  9:          0          0   IO-APIC-level  acpi

 12:      67014      69639    IO-APIC-edge  i8042

 14:       4050       2187    IO-APIC-edge  ide0

 15:     382140     377611    IO-APIC-edge  ide1

 16:     205489         25   IO-APIC-level  ohci_hcd:usb3, eth0

 17:     117400     108776   IO-APIC-level  ide2, ehci_hcd:usb1

 18:      73190      64243   IO-APIC-level  ohci1394, ohci_hcd:usb4, EMU10K1

 19:    1341010    1325885   IO-APIC-level  ohci_hcd:usb2

NMI:          0          0

LOC:   10663223   10663224

ERR:          0

MIS:          0

```

----------

## moesasji

Installing the IRQbalance improved to be a very bad idea here.

My system completely deadlocked after starting this service. 

And as I was stupid enough to add it directly to the default runlevel I couldn't even reboot into a working system. One of those rare "good to have a liveCD lying around situations"

I've tried to switch the IRQbalance options to false in the kernel-config.

That does NOT make the IRQ-balancing work (which makes sense).

Any suggestions what to do to make the IRQ-balancing work would be helpfull.

----------

