Le 18/10/2024 à 03:28, Crystal Wood a écrit :
On Sun, 2024-10-13 at 12:14 +0200, Le Chaudron Nautique wrote:
Thanks a lot.
I think the chrt command is the one I was missing.
I will try to set this up on a raspberry Pi 4b, with the current 6.12
kernel, and maybe later move it to a more robust device if necessary.
The major difficulty I have in my understanding, is sometimes the limit
between userspace and kernel :
I would believe pthread is for userspace and kthread for kernel ? And
the management of pthread would be done by sched fonctions, that of
kthread with chrt ?
chrt is just a command-line tool that calls the sched functions. The
type of thread doesn't matter.
And kthreads are seen as "tasks" with ps where pthread won't be seen,
only the main process ?
Only because there's no kernel "process" to group them under. You can
see all threads in ps with the H option.
As for the interrupts priorities, the top-half will be 50, but I would
still be able to use a different priority for the bottom half if I use
threaded irqs ?
Bottom halves aren't individual threads, so you can't set that kind of
priority. The bottom half should typically run in the IRQ thread that
raised it, though it could also run in ksoftirqd. If you're writing
this driver, it's better to avoid bottom halves entirely, and use other
mechanisms such as workqueues or kthreads to defer work.
-Crystal
Thanks, it's a bit more clear now. You're right, in my case I won't even
need bottom half.
--