I am trying to optimise getting GPIO interrupts into userspace. On the single core rpi 1 I couldn't get rid of quite some timing jitter, which makes sense as there's a lot of stuff going on on the cpu.
Now with the dual core rpi2, I wanted to try this again.
The idea would be:
- have 2 cores handle the OS including as many interrupt sources as possible.
- have 1 core handling the BCM2708 GPIO catchall handler and my kernel modules IRQ
- have 1 core running the userspace program
isolcpus worked nicely to get 2 cpus not being scheduled by regular tasks, but I am struggling with the irqs.
root@ucnraspberrypi2-1:~# echo 3 > /proc/irq/52/smp_affinity
bash: echo: write error: Input/output error
I get the same for any irq when I want to change cpu affinity.
Is that not implemented in the IRQ driver? If not, is there a hardware reason?
Any ideas? Thanks ...
=======
Here's my /proc/interrupts:
root@ucnraspberrypi2-1:~# cat /proc/interrupts
CPU0 CPU1 CPU2 CPU3
16: 0 0 0 0 ARMCTRL bcm2708_fb dma
24: 466 0 0 0 ARMCTRL DMA IRQ
25: 2370 0 0 0 ARMCTRL DMA IRQ
32: 17257562 0 0 0 ARMCTRL dwc_otg, dwc_otg_pcd, dwc_otg_hcd:usb1
52: 1 0 0 0 ARMCTRL BCM2708 GPIO catchall handler
65: 63 0 0 0 ARMCTRL ARM Mailbox IRQ
66: 2 0 0 0 ARMCTRL VCHIQ doorbell
75: 1 0 0 0 ARMCTRL
79: 4 0 0 0 ARMCTRL bcm2708_i2c.1
80: 0 0 0 0 ARMCTRL bcm2708_spi.0
83: 33 0 0 0 ARMCTRL uart-pl011
84: 70207 0 0 0 ARMCTRL mmc0
99: 340237 325956 304090 304089 ARMCTRL arch_timer
273: 1 0 0 0 GPIO Some gpio pin description
FIQ: usb_fiq
IPI0: 0 0 0 0 CPU wakeup interrupts
IPI1: 0 0 0 0 Timer broadcast interrupts
IPI2: 238100 75472 303997 303996 Rescheduling interrupts
IPI3: 2 2 4 4 Function call interrupts
IPI4: 126 10 0 0 Single function call interrupts
IPI5: 0 0 0 0 CPU stop interrupts
IPI6: 0 0 0 0 IRQ work interrupts
IPI7: 0 0 0 0 completion interrupts
Err: 0
smp_affinity
work with the pi1? If so, then it's a driver problem. The kernel has been upgraded to 3.18 recently, and now uses a mechanism known as Device Tree, which means there is quite a bunch of work to convert various drivers. – M Noit Feb 19 '15 at 9:22