Skip to contentSkip to conversation

Controlling cpu for interrupts

DISCUSSION Per Oberg 2 participants 3 messages Jun 9, 2025 – Jun 10, 2025

lore
Share & tools
lore

Per Oberg

author
#0 lore raw

Hi

I have a setup with
- Xenomai 3.1
- Linux 4.14 ish
- RT Net e1000e + igb
- Peak PCAN

When I look closely on the rt-threads I can see that the IRQ from the CAN seems to be coming in on certain cores, but now always the same.

Here is an example of my ../xenomai/irq file:

IRQ CPU0 CPU1 CPU2 CPU3

   18:           0           0           0   130419960         pcan pcan pcan pcan pcan pcan
   19:    88638780           0           0           0         pcan pcan pcan pcan
  127:        3215           0           0           0         rteth0-TxRx-0

Thus, for this case it seems like IRQ19 is handled by CPU0 while IRQ18 is handled on CPU3

What is the heuristics, if any, used for decing this ?

Thanks
Per Öberg

#1 lore raw
Quoted 5 lines · Per Oberg

Hi

I have a setup with
- Xenomai 3.1
- Linux 4.14 ish

Ouch - dead horse (kernel) warning!

Quoted 2 lines

- RT Net e1000e + igb
- Peak PCAN

Standard Linux driver for CAN, right? This is at least my interpretation based on the irq names below.

Quoted 5 lines

When I look closely on the rt-threads I can see that the IRQ from the CAN seems to be coming in on certain cores, but now always the same.

Here is an example of my ../xenomai/irq file:

Quoted 8 lines

IRQ CPU0 CPU1 CPU2 CPU3

   18:           0           0           0   130419960         pcan pcan pcan pcan pcan pcan
   19:    88638780           0           0           0         pcan pcan pcan pcan
  127:        3215           0           0           0         rteth0-TxRx-0

Thus, for this case it seems like IRQ19 is handled by CPU0 while IRQ18 is handled on CPU3

What is the heuristics, if any, used for decing this ?

/proc/irq/*/smp_affinity apply here, at least for standard IRQs. If the mask is containing more than one core, it's up to the IRQ controllers and CPUs who will take an event first.

Jan

Signature · 2 lines
Siemens AG, Foundational Technologies
Linux Expert Center
author
#2 lore raw

----- Den 10 jun 2025, på kl 16:09, Jan Kiszka [email protected] skrev:

Quoted 5 lines
Quoted 4 lines

Hi
I have a setup with
- Xenomai 3.1
- Linux 4.14 ish

Ouch - dead horse (kernel) warning!

Thanks, yes, I know. I am currently debugging an older setup.

Quoted 4 lines
Quoted 2 lines

- RT Net e1000e + igb
- Peak PCAN

Standard Linux driver for CAN, right? This is at least my interpretation based on the irq names below.

No, actually not. I should have said. It's the Peak PCAN xenomai driver

Quoted 11 lines
Quoted 10 lines

When I look closely on the rt-threads I can see that the IRQ from the CAN seems to be coming in on certain cores, but now always the same.

Here is an example of my ../xenomai/irq file:

IRQ CPU0 CPU1 CPU2 CPU3
18: 0 0 0 130419960 pcan pcan pcan pcan
pcan pcan

   19:    88638780           0           0           0         pcan pcan pcan pcan
  127:        3215           0           0           0         rteth0-TxRx-0
Quoted 8 lines
Quoted 5 lines

Thus, for this case it seems like IRQ19 is handled by CPU0 while IRQ18 is handled on CPU3

What is the heuristics, if any, used for decing this ?

/proc/irq/*/smp_affinity apply here, at least for standard IRQs. If the mask is containing more than one core, it's up to the IRQ controllers and CPUs who will take an event first.

Thanks, what would be the corresponding place to look for the RTDM stuff ?

Quoted 1 line

Jan

Thanks
Per Öberg

Quoted 3 lines

--
Siemens AG, Foundational Technologies
Linux Expert Center