作者投稿和查稿 主编审稿 专家审稿 编委审稿 远程编辑

计算机工程 ›› 2007, Vol. 33 ›› Issue (01): 77-79. doi: 10.3969/j.issn.1000-3428.2007.01.026

• 软件技术与数据库 • 上一篇    下一篇

应用中的嵌入式Linux实时优化

梁 丁,李迅波,蔡 勇   

  1. (电子科技大学机械电子工程学院,成都 610054)
  • 收稿日期:1900-01-01 修回日期:1900-01-01 出版日期:2007-01-05 发布日期:2007-01-05

Optimization of Embedded Linux’s Real-time Capability in Application

LIANG Ding, LI Xunbo, CAI Yong   

  1. (College of Machinery and Electronic Engineering, University of Electronic Science and Technology of China, Chengdu 610054)
  • Received:1900-01-01 Revised:1900-01-01 Online:2007-01-05 Published:2007-01-05

摘要: 以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