摘要: 以Linux2.6为对象,在分析了国内外有关提高Linux实时性的几种方法的基础上,对任务切换、优先级调度算法以及中断服务程序提出了改进方式。引入了“在实时系统中,只有当进程的临界区能在下一个实时任务开始之前结束才被允许进入”的任务切换机制,实现了优先级置顶的方法以避免发生优先级倒置的现象,并用内核线程代替中断服务程序。上述方法可用在嵌入式领域和对实时性有较高要求的Linux应用中。
关键词:
Linux,
实时性,
任务切换,
优先级置顶,
内核线程
Abstract: In order to improve the real-time performance of the Linux system, real-time capability improving methods provided by some company or organization is analyzed. A mechanism called “Entering a critical section is allowed only if the operation finishes before the execution of next real-time task” is introduced, together with the implementation of priority ceiling protocol and using the kernel thread to replace the normal ISR. The priorities of real-time tasks are ensured, the priority inversion situations are avoided and the interrupt latency is short and predictable. The method is applicable to embedded systems and other real-time sensitive situations.
Key words:
Linux,
Real-time capability,
Task switch,
Priority ceiling protocol,
Kernel thread
梁 丁;李迅波;蔡 勇. 应用中的嵌入式Linux实时优化[J]. 计算机工程, 2007, 33(01): 77-79.
LIANG Ding; LI Xunbo; CAI Yong. Optimization of Embedded Linux’s Real-time Capability in Application[J]. Computer Engineering, 2007, 33(01): 77-79.