|
The real-time operating system has been widely used in national defense, industrial automatic control, communications and other embedded areas. Compared with the general-purpose operating system, real-time operating system, the main task is the timely handling of the incident, when random events must be able to respond within strict time limits, even if the system is in the high-load, otherwise will lead to serious consequences. Linux 2.6 kernel has been released in the end of 2003, has been proved to be an efficient and stable kernel. Not be preempted area compared to the 2.4 kernel, although 2.6 using some new technology makes real-time performance has been greatly improved, such as preemptive kernel, the new O (1) scheduling algorithm, but the kernel is still a lot of impact on system the real-time performance. In addition, the 2.6 kernel used is based on the O (1) scheduler priority preemptive priority preemption will inevitably lead to a priority inversion the (Priority Inversion) problem, caused by the uncertainty of the task scheduling and seriously affect the system real-time performance. Therefore, in order to meet the embedded system the demanding requirements of real-time, real-time optimized for Linux 2.6 kernel has become an urgent need to solve the problem. In this paper, on the basis of in-depth study of Linux2 .6 kernel, learn from Ingo Molnar's real-time transformation of thinking directly modify the kernel Linux2.6 kernel modifications. Lot Linux2.6 kernel spin lock is used the spinlock, resulting in a lot of the critical region, they will severely affect the real-time nature of the system. Introduced into spinlock spin lock manipulation spinlock mutex mutual demolition lock preemptible skillfully to achieve a new locking mechanism, improve Linux2.6 real-time performance. Not seize the real-time problems caused for the Linux 2.6 kernel interrupt, the interrupt threaded. Interrupt will be run as a kernel thread, but given a different real-time priority interrupt threading, real-time tasks can have higher priority than interrupt thread, so that real-time tasks can be used as the highest priority of execution units to run, even in severe load still guarantee real-time. Linux2.6 the O (1) scheduler priority inversion problem, in order to ensure real-time system, the paper proposes priority inheritance protocol and priority ceiling protocol are two ways to solve, and specific priority inheritance protocol implementations Linux2.6 kernel. Finally, use LMbench test software system context switching time test results show that the improved Linux2.6 kernel on the real-time performance than the original Linux2.6 and Linux2.4 kernel has been further improved, and more suitable for embedded real-time Application.
|