Kernel preemption
In computer operating system design, kernel preemption is a property possessed by some kernels, in which the CPU can be interrupted in the middle of executing kernel code and assigned other tasks (from which it later returns to finish its kernel tasks).
Details
Specifically, the scheduler is permitted to forcibly perform a context switch (on behalf of a runnable and higher-priority process) on a driver or other part of the kernel during its execution, rather than co-operatively waiting for the driver or kernel function (such as a system call) to complete its execution and return control of the processor to the scheduler when done.[1][2][3][4] It is used mainly in monolithic and hybrid kernels, where all or most device drivers are run in kernel space. Linux is an example of a monolithic-kernel operating system with kernel preemption.
The main benefit of kernel preemption is that it solves two issues that would otherwise be problematic for monolithic kernels, in which the kernel consists of one large binary.[5] Without kernel preemption, two major issues exist for monolithic and hybrid kernels:
- A device driver can enter an infinite loop or other unrecoverable state, crashing the whole system.[1]
- Some drivers and system calls on monolithic kernels can be slow to execute, and cannot return control of the processor to the scheduler or other program until they complete execution.[2]
See also
References
- ^ a b "Preemption under Linux". kernelnewbies.org. 2009-08-22. Retrieved 2016-06-10.
- ^ a b Jonathan Corbet (2003-02-24). "Driver porting: the preemptible kernel". LWN.net. Retrieved 2016-06-10.
- ^ "FreeBSD Architecture Handbook, Chapter 8. SMPng Design Document, Section 8.3. General Architecture and Design". freebsd.org. Retrieved 2016-06-10.
- ^ Robert Love (2002-05-01). "Lowering Latency in Linux: Introducing a Preemptible Kernel". Linux Journal. Retrieved 2016-06-10.
- ^ Robert Love (2010). Linux Kernel Development (3 ed.). Pearson Education. ISBN 978-0672329463.
Content Disclaimer
Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.
- The information displayed on this website is sourced in part or in whole from Wikipedia and has been adapted for the purpose of restating it. We strive to provide accurate and relevant information, however:
- There is no guarantee of absolute accuracy. Wikipedia is an open, collaborative project that can be edited by anyone, so information is subject to change.
- It is not intended to constitute professional advice. The content displayed is for informational and educational purposes only. For important decisions (e.g., medical, legal, or financial), please consult a professional.
- Content copyright. Wikipedia is licensed under the Creative Commons Attribution-ShareAlike License (CC BY-SA). This means that content may be reused with appropriate attribution and shared under a similar license.
- Responsible use. Any risk arising from the use of information from this website is entirely the responsibility of the user.