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
About the Author
About the Reviewer
Customer Feedback

Restarting interrupted system calls

We understood in Chapter 1, Comprehending Processes, Address Space, and Threads that user-mode processes invoke system calls to switch into kernel mode for executing kernel services. When a process enters a kernel service routine, there is a possibility of the routine being blocked for availability of resources (for example, wait on exclusion lock) or occurrence of an event (such as interrupts). Such blocking operations require the caller process to be put into the TASK_INTERRUPTIBLE,TASK_UNINTERRUPTIBLE, orTASK_KILLABLE state. The specific state effected depends on the choice of blocking call invoked in the system calls.

If the caller task is put into the TASK_UNINTERRUPTIBLE state, occurrences of signals on that task are generated, causing them to enter the pending list, and are delivered to the process only after completion of the service routine (on its return path to user mode). However, if the task was put into the TASK_INTERRUPTIBLEstate, occurrences...