Cobalt scheduler preemption behavior
C Smith <[email protected]>
| Newsgroups | dev.linux.lists.xenomai |
|---|---|
| Message-ID | <CA+K1mPGqEW4d+HOhyaNhDLe3tv9TFgcUtTFa6hH_7SPq892pXA@mail.gmail.com> |
I am using Xenomai 3.1, Cobalt kernel 4.19.229 X8664 (I know it's old but this is a legacy system our company still develops). I am wondering about expected Cobalt scheduler behavior on a single core. I have set isolcpus to reserve core 1, my first real time task sets affinity to core 1, the priority is 99. ret = rt_task_create(&main_task, "my_rt_task", 0, 99, T_JOINABLE); CPU_ZERO(&cpus); CPU_SET(1, &cpus); rt_task_set_affinity(&main_task, &cpus) Then I do the same with a second RT task, giving it the same priority (99) and same CPU core 1 affinity. First Question: If the first RT task is executing, and the second RT task wakes up from a sleep, can I expect the scheduler to preempt the first RT task to run the second RT task on that same CPU core? I put DIO pulses around both tasks and the oscilloscope says 'yes', the second task preempts the first. I'm a bit confused about that, as I expected FIFO non-preemptable behavior from the Cobalt kernel. ie: I thought the first task would finish, then the second task would run. Second question: Is there a way to configure the Cobalt kernel, or my two RT tasks, such that they can't preempt one another, but when there is contention the first to run is allowed to finish before the second runs? thanks, -C Smith