Le Chaudron Nautique <vanvan@xxxxxxxxxxxxxxxxxxxx> wrote: > after a lot of reading, I believe I'm still missing something concerning > "priority" level (or is it my understanding of the kernel ?). Welcome to the PREEMPT_RT community. The best resource for getting started is the RT wiki: https://wiki.linuxfoundation.org/realtime/start When you post to ask questions, it's a good idea to mention which kernel version and which architecture you're using. > I would like to set up the reading of an encoder (via GPIO) and the > triggering of an output with RT to be able to define the max speed. > Every thing else can be non-RT > > If it write a kernel module (I used the site of embetronix for that) to > manage the GPIO interrupts and output, what is the "priority" of this > module (since interrupts are priority 50 I assume ? I believe we can't > change this value) Interrupt threads are by default assigned the SCHED_FIFO priority 50 by the kernel. The thread(s) created by the module will run as SCHED_OTHER unless you set SCHED_FIFO from userspace with "man 1 chrt." The priority can be manipulated with either "man 1 taskset" or good old "nice." View the threads with, for example, $ ps -elFy | grep "\[" > If I use cpu isolation / interruts cpu affinity, is that equivalent to > dedicate a cpu to this module ? Or will it still sometimes be "busy" > with other cpus ? > > If I am not mistaken, it is not possible to manage affinity between > kernel module and cpu, it is only for the treads or interrupt by masking ? There are many complex and subtle approaches that you can try, but odds are good since your use case sounds simple that some combination of chrt and taskset will solve your problem. If not, read the RT wiki carefully about other possibilities. > > Thanks for your help. > > Mathieu Good luck, Alison Chaiken Aurora Innovation