Book Image

Mastering Linux Kernel Development

By : CH Raghav Maruthi
Book Image

Mastering Linux Kernel Development

By: CH Raghav Maruthi

Overview of this book

Mastering Linux Kernel Development looks at the Linux kernel, its internal arrangement and design, and various core subsystems, helping you to gain significant understanding of this open source marvel. You will look at how the Linux kernel, which possesses a kind of collective intelligence thanks to its scores of contributors, remains so elegant owing to its great design. This book also looks at all the key kernel code, core data structures, functions, and macros, giving you a comprehensive foundation of the implementation details of the kernel’s core services and mechanisms. You will also look at the Linux kernel as well-designed software, which gives us insights into software design in general that are easily scalable yet fundamentally strong and safe. By the end of this book, you will have considerable understanding of and appreciation for the Linux kernel.
Table of Contents (19 chapters)
Title Page
Credits
About the Author
About the Reviewer
www.PacktPub.com
Customer Feedback
Preface
Index

Real-time scheduling class


Linux supports soft real-time tasks and they are scheduled by the real-time scheduling class. rt processes are assigned static priorities and are unchanged dynamically by the kernel. As real-time tasks aim at deterministic runs and desire control over when and how long they are to be scheduled, they are always given preference over normal tasks (SCHED_NORMAL). Unlike CFS, which uses rb tree as its sub-runqueue, the rt scheduler, which is less complicated, uses a simple linked list per priority value (1 to 99). Linux applies two real-time policies, rr and fifo, when scheduling static priority processes; these are indicated by the policy element of struct task_struct.

  • SCHED_FIFO (1): This uses the first in, first out method to schedule soft real-time processes
  • SCHED_RR (2): This is the round-robin policy used to schedule soft real-time processes

FIFO

FIFO is a scheduling mechanism applied to processes with priorities higher than 0 (0 is assigned to normal processes)...