
Using Standard Operating Systems for Time Critical Applications with special emphasis on LINUX von Arnd Christian Heursch Dissertation zur Erlangung des akademischen Grades eines Doktors der Naturwissenschaften (Dr. rer.nat.) Neubiberg, 10. November 2006 1. Gutachter: Prof. Dr. rer. nat. Helmut Rzehak 2. Gutachter: Prof. Dr. rer. nat. Gunnar Teege Fakult¨atf¨urInformatik Universit¨atder Bundeswehr M¨unchen 2 Universit¨at der Bundeswehr M¨unchen Fakult¨at f¨urInformatik Thema der Dissertation: Using Standard Operating Systems for Time Critical Applications with special emphasis on LINUX Verfasser: Arnd Christian Heursch Promotionsausschuss: Vorsitzender: Prof. Dr. Andreas Karcher 1. Berichterstatter: Prof. Dr. Helmut Rzehak 2. Berichterstatter: Prof. Dr. Gunnar Teege Weiterer Pr¨ufer: Prof. Dr. Klaus Buchenrieder Weiterer Pr¨ufer: Prof. Dr. Mark Minas Tag der Pr¨ufung: 10. November 2006 Mit der Promotion erlangter Doktor der Naturwissenschaften akademischer Grad: (Dr. rer. nat.) Neubiberg, den 12. November 2006 Contents 1 Introduction 11 1.1 Motivation ............................................ 11 1.2 Aim of this thesis ......................................... 12 1.3 Preconditions: The hardware platform chosen ......................... 14 1.4 Outline .............................................. 15 2 Basic model of hardware and operating system 17 2.1 Hardware model and arising latencies ............................. 17 2.2 Basic elements and mechanisms of modern operating systems ................ 22 2.3 The POSIX standard ....................................... 29 3 Metrics for evaluating operating systems 31 3.1 Fundamentals of computer performance analysis ....................... 31 3.2 Real-time - definitions and explanations ............................ 32 3.3 Schedulability and WCET-analysis ............................... 35 3.4 Performance analysis ....................................... 35 3.5 Modeling ............................................. 36 3.6 Measuring methods ........................................ 37 3.7 Measurements of time rely on precise clocks .......................... 42 3.8 Monitors .............................................. 45 3.9 Orthogonal Walsh correlations ................................. 50 4 Architecture of systems serving time-critical tasks 53 4.1 Architectures for standard and time-critical applications ................... 53 4.2 Combining divergent goals .................................... 57 4.3 Special requirements for realtime operating systems ..................... 60 4.4 Preemption Points ........................................ 62 4.5 Critical sections to avoid race conditions ............................ 65 4.6 Using mutexes to protect critical sections ........................... 66 3 4 CONTENTS 5 Improving Linux to serve time-critical applications 79 5.1 Soft-realtime requirements for the Linux kernel ........................ 79 5.2 Parts of the POSIX standard supported by Linux ....................... 81 6 Metrological evaluation of scheduler and interrupts 85 6.1 The scheduler of the Linux kernel ................................ 85 6.2 Interrupts and Soft-Interrupts .................................. 90 7 Preemptability - Measuring to judge implemented concepts 97 7.1 Non-preemptible regions in the Linux kernel .......................... 97 7.2 Analytical formula of the PDLT for a soft-realtime task ................... 97 7.3 Introducing Preemption Points into the kernel ......................... 99 7.4 The ’Preemptible Linux Kernel’ ................................. 104 7.5 Steps towards a ’Fully Preemptible Linux kernel’ ....................... 110 8 Analyzing and improving the Linux timing subsystem 119 8.1 Time base of the standard Linux kernel ............................ 119 8.2 Rapid Reaction Linux ...................................... 128 8.3 Examining performance using the Rhealstone Benchmark .................. 138 9 Summary 141 9.1 Conclusion ............................................ 141 9.2 Future prospects ......................................... 145 A Measuring systems 149 A.1 AMD K6 ............................................. 149 A.2 Pentium 4 ............................................. 149 CONTENTS 5 Acknowledgements This thesis has been carried out under the guidance of Professor Helmut Rzehak while I worked as a research and teaching assistant at the Institute of Information Technology Systems at the Department of Computer Science of the University of the Federal Armed Forces Munich, Germany. In this place, I would like to express my profound gratitude to Professor Rzehak for providing me such an interesting theme for which the topicality even grew in recent years. His kind support throughout the years, even when emerited, made this thesis possible. Working to make a standard operating system like Linux more suitable for time-critical tasks, is a very interesting task, in which a lot of people, i.e. the Linux kernel Open Source community, especially researchers of operating systems and developers of embedded systems, are interested and take part in. So this thesis is embedded in the world wide and ongoing research and development how to make the Linux kernel more compliant for time-critical tasks. Therefore it was never difficult to publish results on a conference. It was fun to watch the Linux kernel developping during recent years and also very interesting to take small part in its development a few times. Prof.Dr. Gunnar Teege, who followed Prof.Dr. Rzehak after his emeritation, I thank for his kind support during the recent years that made it possible to me to continue my work on this thesis. I also thank him very much for proof-reading this thesis. My special thanks go to Prof.Dr. Burkhard Stiller - who has been the head of our institute for several years - for the good working and learning atmosphere at our institute and for always being addressable. Many thanks also go to my predecessor, Prof.Dr. Michael M¨achtel, who developped in his thesis a software monitor that was helpful to measure and visualize time-critical internal operations of the Linux kernel. I thank all fellow research assistants for the cooperative working atmosphere. Especially, I thank Mr.J.P.Sauerland for his kind technical help, and for providing test beds and computers needed to execute this thesis always in time. Many thanks go to those students of my University who supported this thesis while achieving their diploma thesis or student’s research projects in this field of research, namely to Dirk Grambow, Alexander Horstkotte, Witold Jaworski, Alexander Koenen, Mirko Pracht, Dirk Roedel and Robert Koch. I thank my wife for supporting me and for her loving understanding when this thesis took a lot of time to do, that i couldn’t spend with her and the children. Arnd Christian Heursch, Neubiberg near Munich, Germany, November 2006 6 CONTENTS Disclaimer All pieces of information and statements in this document have been carefully composed and are believed to be accurate, they reflect the current state of research. Nevertheless it is possible that parts of it are old, incomplete or even incorrect. The document is provided ”as is”, without warranty of any kind, without even the implied warranty of merchantability or fitness for a particular purpose. Users must take full responsibility for their application of any products, named herein. In no event shall the author, the reviewers, the university or any other party be liable for any damages, including any indirect, general, special, consequential, or incidental damages, arising out of the use or inability to use this document, even if the author, the reviewers, the university or any other party has been advised of the possibility of such damages. Please take into account also the notice at the start of the bibliography. Linux is a registered trademark of Linus Torvalds. All other trademarks or service marks mentioned in this document are the property of their respective owners. CONTENTS 7 Abstract Traditionally, time-critical tasks have been carried out only by proprietary realtime operating systems running on embedded systems with proprietary hardware, available only for industry or military organi- zations. Others could normally not afford such systems and thus couldn’t execute time-critical tasks on the computer systems available to them. But in recent decades hardware in computer systems evolved in a fast way and got cheaper, so today many users own off-the-shelf PCs at home that are able to perform so called soft realtime tasks like replaying music and films. While in former times a realtime system was designated only to work for its purpose, the user of today wants to do traditional PC work like writing text, executing calculations, playing games and on the same time for instance hear a music CD or DVD. In order to make an off-the-shelf PC able to do all these tasks at the same time in a quality sufficient to the user, not only the hardware has to evolve, but also changes in the standard operating systems, home users use are necessary. One can observe a second development: Because of their broad functionality, the huge amount of software available, and the many people supporting Linux and Java by porting it to new hardware or providing new software, standard operating systems like Linux are used more and more even in Embedded Systems like mobile phones, settop boxes or DVD players. Software developers even try to fulfill time-critical tasks with soft-realtime requirements using cheap standard operating systems in order
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages156 Page
-
File Size-