WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: smp_affinity problem  (Read 3474 times)

Offline Јаневски

  • Jr. Member
  • **
  • Posts: 61
smp_affinity problem
« on: April 02, 2013, 12:57:24 AM »
Hello,

I've been using TinyCore Linux on a board with multiple NICs and i ran into the following problem:
Code: [Select]
cat /proc/interrupts
----
           CPU0       CPU1       
  0:         46          0   IO-APIC-edge      timer
  1:          2          0   IO-APIC-edge      i8042
  6:          2          0   IO-APIC-edge      floppy
  8:          0          0   IO-APIC-edge      rtc0
  9:          0          0   IO-APIC-fasteoi   acpi
 12:          4          0   IO-APIC-edge      i8042
 16:    7068508          0   IO-APIC-fasteoi   ahci, uhci_hcd:usb3, eth4
 17:         10          0   IO-APIC-fasteoi   pata_jmicron
 18:          5          0   IO-APIC-fasteoi   ehci_hcd:usb1, uhci_hcd:usb7, eth2
 19:  156455084          0   IO-APIC-fasteoi   ata_piix, ata_piix, uhci_hcd:usb6, eth3
 21:  132342645          0   IO-APIC-fasteoi   uhci_hcd:usb4, eth1
 23:       6063          0   IO-APIC-fasteoi   ehci_hcd:usb2, uhci_hcd:usb5
 43:   10692563          0   PCI-MSI-edge      eth0
NMI:          0          0   Non-maskable interrupts
LOC:    1790132     915131   Local timer interrupts
SPU:          0          0   Spurious interrupts
PMI:          0          0   Performance monitoring interrupts
IWI:          0          0   IRQ work interrupts
RES:     309061      47221   Rescheduling interrupts
CAL:        121       9351   Function call interrupts
TLB:       5131       3642   TLB shootdowns
TRM:          0          0   Thermal event interrupts
THR:          0          0   Threshold APIC interrupts
MCE:          0          0   Machine check exceptions
MCP:        268        268   Machine check polls
ERR:          0
MIS:          0
----

The irq smp_affinity mask of the network cards is set to 3 on all cards on a 2 core machine, however i don't get balanced IRQs.
The cards only hit the first core.
If i try to switch them to the second core manually, or the first core the IRQs are sent properly to the specified single cores, however if both are specified then there is no IRQ balancing.

As far as we're on the subject, is there any usable option of device polling in Linux (the only one i've found is NAPI and smp affinity), is there something similar to FreeBSD sysctl enable kernel device polling?

Best Regards,
Jovan

         [EDIT]: Added code tags.  Rich
« Last Edit: April 02, 2013, 08:11:02 AM by Rich »

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11178
Re: smp_affinity problem
« Reply #1 on: April 02, 2013, 08:05:24 AM »
Hi Јаневски
Quote
is there something similar to FreeBSD sysctl enable kernel device polling?
Tinycore includes the busybox version of  sysctl. Or maybe you are looking for  procps.tcz.

Offline Јаневски

  • Jr. Member
  • **
  • Posts: 61
Re: smp_affinity problem
« Reply #2 on: April 02, 2013, 09:25:42 PM »
Hi Јаневски
Quote
is there something similar to FreeBSD sysctl enable kernel device polling?
Tinycore includes the busybox version of  sysctl. Or maybe you are looking for  procps.tcz.
Hello Rich,

Thank You for Your answer.

I just mentioned sysctl because people mostly use it, i'm actually using cat to read and echo to write to /proc objects thus i don't need sysctl or similar.
The problem i'm actually having is interrupts not being balanced to multiple cores, as specified by the smp_affinity mask.
My second question was if in Linux there is FreeBSD-like device polling, (in order to avoid full core interrupt storms at the cost of degraded device service performance), but i think so far the only option in Linux i have is smp_affinity.

Best Regads,
Jovan
« Last Edit: April 02, 2013, 09:30:08 PM by Јаневски »