Triggering UserCode from KernelModule (IRQ)
Hi all!
I am currently evaluting the RT_PREEMPT kernel as a replacement for a Xenomai based real time application. (Intel Core2Duo PCs).
So far, everything works really fine and the performance is about the same as with Xenomai. Great work!
However, I have one question:
I have a PCI hardware I/O board that exchanges data with the user mode directly (by using mmap), this works fine.
However, there is one operation mode that uses interrupts to signal incoming data. The interrupt handler is realized as a tiny kernel module (that one that provides also the mmap for the user mode application).
Now I am not sure how the signalling of the IRQ from kernel to user mode could be realized best (in terms of low latency).
The "classical" approach for this task is to provide a character driver with a .poll file operation. In Xenomai I could use a semaphore that was accessible from kernel and user space for this. What is the best way in the RT_PREEMPT "world"?
Thanks a lot for all feedback on this question.
Regards
Mathias
Signature · 11 lines
Mathias Koehrer [email protected] Arcor.de Gaming Area - kostenfrei daddeln bis der Arzt kommt! Jetzt checken und aus über 80 Spielen wählen! http://www.arcor.de/footer-gaming/ -- To unsubscribe from this list: send the line "unsubscribe linux-rt-users" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 6 lines · M. Koehrer
Hi all!
I am currently evaluting the
RT_PREEMPTkernel as a replacement for a Xenomai based real time application. (Intel Core2Duo PCs).
So far, everything works really fine and the performance is about the same as with Xenomai. Great work!
I thought I saw something someplace about Xenomai supporting preempt_rt as a real time layer. So you might not need to do much to your application in order to switch ..
Daniel
Quoted 10 lines · M. Koehrer
However, there is one operation mode that uses interrupts to signal incoming data. The interrupt handler is realized as a tiny kernel module (that one that provides also the mmap for the user mode application). Now I am not sure how the signalling of the IRQ from kernel to user mode could be realized best (in terms of low latency).
The "classical" approach for this task is to provide a character driver with a .poll file operation. In Xenomai I could use a semaphore that was accessible from kernel and user space for this. What is the best way in the
RT_PREEMPT"world"?
UIO might be a good choice here, the rest is giving the interrupt handler and the processes the right priorities.
rsc
Signature · 4 lines
Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
A message that is not in the archive (sent off-list or not yet received): [email protected]
Hi Claus,
thanks for the feedback.
Quoted 7 lines
simply write an UIO driver for your I/O-HW. You find an excellent howto in
http://www.osadl.org/UIO.uio0.0.htmlThe UIO-driver has 2 benefits for you:
1. It provides you with direct access to the mmapped area from user space, freeing you from the necessity to communicate via the /dev interface.
2. It can invoke a handler function in user space, if an interrupt occurs.
That is really cool for a new driver, however I have an already existing driver (that works with Xenomai) and in the first step I do not want to change too much... The only missing piece here is the "triggering" of my user space task whenever an interrupt occurred.
Is the .poll approach real time capable or is there another approach better?
Thanks a lot
Regards
Mathias
Signature · 11 lines
Mathias Koehrer [email protected] Arcor.de Gaming Area - kostenfrei daddeln bis der Arzt kommt! Jetzt checken und aus über 80 Spielen wählen! http://www.arcor.de/footer-gaming/ -- To unsubscribe from this list: send the line "unsubscribe linux-rt-users" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html