Linux2.6内核实时性关键技术的研究
![](/assets/7a34688/images/icon/s-doc.png)
VIP免费
Linux2.6 内核实时性关键技术的研究
Linux2.6 内核实时性关键技术的研究
摘要
Linux 内核的高效和稳定已经在各个领域内得到了大量事实的验证,Linux 的内核可以
裁剪得非常小巧,很适合于嵌入式系统的需要。嵌入式 Linux 的优点在于它的版权免费、源码
开放、结构紧凑,这为日益增长的应用软件基础提供了坚实的后盾。但是由于 Linux 是一种通
用操作系统,而不是一个真正的实时操作系统,而只能称其为软实时操作系统,而不是一种
强实时系统。其标准内核不支持事件优先级和抢占实时特性,没提供很多嵌入式应用程序所
需要的可预测响应时间等。所以,在进行嵌入式 Linux 系统动态扩展性研究开发时,首要的
问题是扩展 Linux 的实时性能。
本文首先对然后对 Linux2.6 操作系统体系结构的进行分析,结合对 Linux 任务响应时
间分析,说明了 Linux 操作系统实时性能不强的原因,接着针对各个原因提出了相应的解决
方法。然后本文根据实时性能不强的原因提出了三个解决的方法:时钟,任务调度和中断。
首先分析 Linux 2.6 内核时钟机制中时钟粒度过粗的问题,借鉴有关时钟机制的改造思
想,将 One-Shot Mode(单次触发模式)引入了 Linux2.6 定时器,实现了新的时钟机制。使得
系统在达到了微秒级时钟精度的同时,保持了原有的负载能力。其次研究 Linux 2.6 内核进
程调度机制,借鉴了优秀的动态实时调度算法 LSF(最小裕度优先算法)的“裕度”思想,将
其与崭新的 Linux2.6 进程调度结构相结合,在保持了原有系统 O(1)调度特性的同时,有效
地增强了实时调度能力,并在实时内核的进程调度模块中实现了单调速率分析算法(RMS)和
最早期限优先算法(EDF)。再次分析 Linux 2.6 内核中断机制。然后,通过与当前任务的实时
优先级的比较为中断安排恰当的执行时间的思想,将中断作为内核线程并赋予不同的实时优
先级,在中断服务程序入口函数中进行当前任务优先级与中断线程优先级的比较,不同的情
况进行不同的处理,从而保证实时性高的任务不被打扰,优先级高的中断能立即响应。最后
通过性能测试证明本文的方法在对系统的实时性有很大的提高。
关键字:Linux,时钟,中断,实时,调度
Study of Critical Technology of Linux2.6 Kernel Real-Time
Linux2.6 内核实时性关键技术的研究
Abstract
The high efficiency and stable of Linux kernel has been verified in most of fields. It is flexible
for Linux kernel to cut out it and it is appropriate for embedded system Kernel. Its advantage is free,
opening source, stable. Linux provides a strong supporter for developing applied software.
But as a general operation system and Linux is not a really real time operation system, so it is
only named soft real time and is not hard real time operation system. Its standard kernel has not
supported event priority and preempted real time, at the same time, it has not provided predictable
response time which has been needed for most of embedded application. So it is important to extend
its -real time performance during developing embedded Linux system.
This disseration analyzes the architecture of Linux 2.6 operating systemand the main factors
which affect the capability of real-time, and then brings out a solution for each factor. Following
this , the accoding solutions are put out. Then this paper puts forward three solutions to the main
factors: Timer, Scheduling, Interrupt.As to the problem of Linux 2.6 kernel's too large timer
granularity in timer mechanism, One-shot Mode is introduced in Linux timers from the principle of
timer mechanism improvement the new timer mechanism is implemented skillfully. The new timer
mechanism makes the system reached the microsecond level timer precision and maintains its
original Load capability. As to the problem of Linux 2.6 kernel lacking in real-time scheduling
algorithms and policies in the scheduler mechanism, the "laxity" notion is introduced from the good
dynamic real-time schedule algorithm LSF(laxity small first). Combination of the laxity and the
new task scheduler data structure in Linux2.6 enhances the system's real-time scheduler capability
as well as maintains the original O (1) scheduling characteristic; design the real time schedulers
EDF and RMS for Linux in real time kernel schedule processor.It ananlyzes Linux 2.6 kernel
interrupt mechanize, and takes the following thoughts that compares to the current priority and
arranges the measurable execute time, takes the interrupt ad the kernel procedure and puts it the
different priority. Comparing the current priority to the interrupt priority in the entry function of
interrute procedure, it process the different function according to different conditions. Thus it can
ensures the preferential task not to be disturbed, and quickly be responsed. At last, it is tested that
the real-time performance can be enhaned .
KeyWords:Linux,Timer;Interrupt;Rel-time,Schedule
Linux2.6 内核实时性关键技术的研究
目录
摘要...........................................................................1
Abstract.......................................................................2
第一章 绪论....................................................................4
1.1 课题的研究背景和意义....................................................4
1.2 国内外研究状况..........................................................5
1.3本课题的研究意义........................................................6
1.4本课题的研究内容........................................................6
1.5 全文的安排..............................................................7
第二章 Linux2.6 内核实时性分析.................................................8
2.1 Linux 内核结构和功能....................................................8
2.2 Linux 实时性不强原因的分析.............................................10
2.3 开发 Linux2.6 内核实时性的特点.........................................12
2.4 Linux 内核实时化常用方法...............................................13
2.5本章小结...............................................................14
第三章 Linux2.6 内核时钟系统的改进............................................15
3.1Linux 内核时钟机制......................................................15
3.2 细粒度定时器的实现原理.................................................18
3.3本章小结...............................................................21
第四章 Linux2.6 内核的调度机制改造............................................21
4.1 Linux2.6 内核的调度机制................................................21
4.1.1 全新的可运行队列 runqueue.........................................21
4.1.2 改进的 task_struct 数据结构.......................................23
4.1.3调度函数 schedule()...............................................24
4.1.4 O(1)调度算法..................................................25
4.1.5 实时调度的缺陷...................................................26
4.2 常用的实时调度算法....................................................26
4.2.1 基于优先级的调度算法.............................................26
4.2.2 基于比例共享调度算法.............................................28
4.2.3基于时间的进程调度算法...........................................28
4.2.4基于优先级的 LSF 调度算法..........................................28
4.3实时调度器的设计.......................................................29
4.3.1 EDF 调度器.......................................................29
摘要:
展开>>
收起<<
Linux2.6内核实时性关键技术的研究Linux2.6内核实时性关键技术的研究摘要Linux内核的高效和稳定已经在各个领域内得到了大量事实的验证,Linux的内核可以裁剪得非常小巧,很适合于嵌入式系统的需要。嵌入式Linux的优点在于它的版权免费、源码开放、结构紧凑,这为日益增长的应用软件基础提供了坚实的后盾。但是由于Linux是一种通用操作系统,而不是一个真正的实时操作系统,而只能称其为软实时操作系统,而不是一种强实时系统。其标准内核不支持事件优先级和抢占实时特性,没提供很多嵌入式应用程序所需要的可预测响应时间等。所以,在进行嵌入式Linux系统动态扩展性研究开发时,首要的问题是扩展Lin...
相关推荐
-
VIP免费2025-01-09 9
-
VIP免费2025-01-09 6
-
VIP免费2025-01-09 6
-
VIP免费2025-01-09 6
-
VIP免费2025-01-09 6
-
VIP免费2025-01-09 9
-
VIP免费2025-01-09 8
-
VIP免费2025-01-09 7
-
VIP免费2025-01-09 8
-
VIP免费2025-01-09 7
作者:朱铭铭
分类:高等教育资料
价格:150积分
属性:47 页
大小:733KB
格式:DOC
时间:2024-09-20