I'm wondering what the difference between PREEMPT_NONE and PREEMPT_VOLUNTARY are. According to the documentation,
This option reduces the latency of the kernel by adding more
"explicit preemption points" to the kernel code
But it does not mention what these points are. I tried googling it, but I didn't find any more details than the text above (which seems surprising, as I would think this would be a common question). My main concern is processes starving other processes, so I'm wondering if preemption occurs on timer interrupts with VOLUNTARY. Of course the more info the better, so I'm wondering what the other preemtion points might be.
I believe this link to a mailing list has the answer.
Which is that might_sleep()
and might_resched()
become voluntary preemption points. Enabling PREEMPT_VOLUNTARY makes it call the function cond_resched()
.
And no, voluntary preemption does not occur on interrupts. That would be full preemption, which checks on each interrupt and if the kernel not flagged to block preemption, it switches to the highest priority task.
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