Priority of kernel modules and SCHED_RR threads

社会主义新天地 提交于 2019-12-05 04:47:00

Not all kernel thread have an RT priority. Imagine a periodically waking up thread that needs to do some background work is waking up. You don't want this thread to preemt your RT thread. So I guess your first assumption is wrong.

Based on your other questions :

  • your main processing loop receives SPI data through a queue
  • the spi processing thread feeds the main processing queue

It seems your main processing thread get in the way of the spi driver thread responsible for the spi data transfer.

Here is what happens :

  • an IRQ is fired
  • spi_async is called, which means a data transfer is queued, that will be picked up by a thread created by the spi master driver.
  • spi master thread compete with your main processing thread, the laser thread, but this kernel thread has not RT priority, so it looses every time one of the RR thread is running.

What you can do is going back to normal scheduling, while playing with the various CONFIG_PREEMPT_ options. Or mess with the spi master driver, to ensure that any delayed work is queued with enough priority. Or even not queued at all.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!