I'm working on an embedded Linux project, using an arago distribution that is probably around version 3.3.
I have configured a high-resolution Linux timer to wake-up my process once per millisecond. This works ok but there are two issues with the timing:
I attribute these problems to the less-than real-time performance of Linux. But I need to investigate ways of improving the real-time performance.
I have checked that the kernel is configured with the CONFIG_PREEMPT kernel option, which is good for real-time.
I have also applied the SCHED_FIFO scheduling class to my process:
struct sched_param schedparm;
memset(&schedparm, 0, sizeof(schedparm));
schedparm.sched_priority = 1; // lowest rt priority
sched_setscheduler(0, SCHED_FIFO, &schedparm);
but that made no difference.
I guess that a logical step is to apply the PREEMPT_RT patch to the kernel build, but I haven't identified how to do that yet.
Is there anything else I can do to improve the jitter / duration variability?
Or can anyone suggest an accessible tutorial on how to apply the PREEMPT_RT patch?
It seems PREEMPT_RT is the logical next step. Did you try this tutorial?
https://rt.wiki.kernel.org/index.php/RT_PREEMPT_HOWTO
Update: I suggest you look at how others build a preemptive kernel, e.g. here: https://aur.archlinux.org/packages/linux-rt/
You can read the PKGBUILD to understand what is done.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With