[LITMUS^RT] Interrupt Context

Björn Brandenburg bbb at mpi-sws.org
Mon Jul 24 15:56:57 CEST 2017


Hi Neil,

> On 24. Jul 2017, at 15:42, Neil Patrao <illusion.webs at ymail.com> wrote:
> 
> 
> (2) implies: A PCIe board produces interrupts. The driver API let's me setup the interrupt handler. To set up the interrupt handler, I pass the pointer to my function so that when the interrupt occurs, my function executes.

this sounds like a fairly involved driver. Is your process a regular Linux task? If yes, then your callback function most likely isn’t called directly by the interrupt. Rather, there needs to be some driver interface (e.g, a character device driver) that relays the information that an interrupt occurred from the kernel to userspace. 

Can you point us to a description of the device and its driver?

> 
> From what you said, I understand that my function does not run in the context of my RT process.

This depends on whether you are running in kernel mode or in user mode. 

> 
> In this case, is there a way to handle interrupts so that they run in RT mode? 

You can make ksoftirqd a LITMUS^RT real-time task. You can also force certain drivers to run as threads, which you can then also make into LITMUS^RT real-time tasks.

> 
> If not, does it mean that the interrupt handler function runs as a normal Linux process?

No. Interrupt handlers do not run as processes in mainline Linux. 


- Björn

PS: Please keep the discussion on the list.





More information about the litmus-dev mailing list