Is the Linux kernel a process?
Improve Article Show Save Article Improve Article Save Article The main purpose of a computer is to run a predefined sequence of instructions, known as a program. A program under execution is often referred to as a process. Now, most special purpose computers are meant to run a single process, but in a sophisticated system such a general purpose computer, are intended to run many processes simultaneously. Any kind of process requires hardware resources such as Memory, Processor time, Storage space, etc. In a General Purpose Computer running many processes simultaneously, we need a middle layer to manage the distribution of the hardware resources of the computer efficiently and fairly among all the various processes running on the computer. This middle layer is referred to as the kernel. Basically the kernel virtualizes the common hardware resources of the computer to provide each process with its own virtual resources. This makes the process seem as it is the sole process running on the machine. The kernel is also responsible for preventing and mitigating conflicts between different processes. This schematically represented below: Figure: Virtual Resources for each Process The Core Subsystems of the Linux Kernel are as follows:
Figure: The Linux KernelFor the purpose of this article we will only be focussing on the 1st three important subsystems of the Linux Kernel. The basic functioning of each of the 1st three subsystems is elaborated below:
Previous answers are excellent, pointing out that threads are processes inside the Linux kernel and that you can clone( ) any subset of the process state you like anyway. But I think it's helpful to remember that it matters how much context can be shared or must be saved uniquely, and how many cycles it may take for a context switch, which may depend on how much is likely to be different, not just as far as the OS is concerned, but also in the hardware, e.g., the TLB. So it matters what is cloned and what is shared. At the application level, a new thread (as conventionally understood, sharing the memory image, current directory, open file handles, etc.) is always cheaper than a new process that at best only initially shares any of this. Even if the process is forked with copy-on-write, as soon as it writes, you do have to make the copy. This is why, in designing an application, it's a lot more reasonable to create 10,000 threads than 10,000 processes. The reasons to do a new process are to run a different executable or to firewall for security reasons. Contact us Welcome, Log in to your Red Hat account Log in Your Red Hat account gives you access to your member profile and preferences, and the following services based on your customer status:
Register now Not registered yet? Here are a few reasons why you should be:
For your security, if you're on a public computer and have finished using your Red Hat services, please be sure to log out. Log out Account Log in
OverviewThe Linux® kernel is the main component of a Linux operating system (OS) and is the core interface between a computer’s hardware and its processes. It communicates between the 2, managing resources as efficiently as possible. The kernel is so named because—like a seed inside a hard shell—it exists within the OS and controls all the major functions of the hardware, whether it’s a phone, laptop, server, or any other kind of computer.
What the kernel doesThe kernel has 4 jobs:
The kernel, if implemented properly, is invisible to the user, working in its own little world known as kernel space, where it allocates memory and keeps track of where everything is stored. What the user sees—like web browsers and files—are known as the user space. These applications interact with the kernel through a system call interface (SCI). Think about it like this: The kernel is a busy personal assistant for a powerful executive (the hardware). It’s the assistant’s job to relay messages and requests (processes) from employees and the public (users) to the executive, to remember what is stored where (memory), and to determine who has access to the executive at any given time and for how long.
Where the kernel fits within the OSTo put the kernel in context, you can think of a Linux machine as having 3 layers:
Code executed by the system runs on CPUs in 1 of 2 modes: kernel mode or user mode. Code running in the kernel mode has unrestricted access to the hardware, while user mode restricts access to the CPU and memory to the SCI. A similar separation exists for memory (kernel space and user space). These 2 small details form the base for some complicated operations like privilege separation for security, building containers, and virtual machines. This also means that if a process fails in user mode, the damage is limited and can be recovered by the kernel. However, because of its access to memory and the processor, a kernel process crash can crash the entire system. Since there are safeguards in place and permissions required to cross boundaries, user process crashes usually can’t cause too many problems.
Why choose Red Hat?At Red Hat, Linux is the foundation of everything we do. Red Hat is the second largest corporate contributor to the Linux kernel, bringing with it the experience and expertise of 25 years and a large community of partners, customers, and experts from across the industry. That’s a long relationship, with a history and level of experience that’s hard to come by. The Linux kernel is open source, and open source is at the core of Red Hat’s values. Learn why we’ve built our company on our conviction that Red Hat® Enterprise Linux is the best.
Linux is an open source operating system that is made up of the kernel, the base component of the OS, and the tools, apps, and services bundled along with it.
Security-Enhanced Linux (SELinux) is a security architecture for Linux® systems that allows administrators to have more control over who can access the system.
Article The Linux kernel is the main component of a Linux operating system (OS) and is the core interface between a computer’s hardware and its processes. More about LinuxProductsA stable, proven foundation that’s versatile enough for rolling out new applications, virtualizing environments, and creating a more secure hybrid cloud. Related articlesResources
Analyst material For SAP Landscapes, Migration Means Much More Than Just Linux
Analyst material IDC: Economic Impact of Red Hat Enterprise Linux
Keep exploringGet more content like thisSign up for our free newsletter, Red Hat Shares. Is kernel part of process?A kernel is bigger than a process. It creates and manages processes. A kernel is the base of an operating System to make it possible to work with processes. Save this answer.
Is Linux a process?Linux is a multiprocessing operating system, its objective is to have a process running on each CPU in the system at all times, to maximize CPU utilization. If there are more processes than CPUs (and there usually are), the rest of the processes must wait before a CPU becomes free until they can be run.
What is the difference between kernel and process?Kernel thread is a type of thread in which threads of a process are managed at kernel level. Kernel threads are scheduled by operating system (kernel mode). Process is a program being executed. Kernel thread is the thread managed at kernel level.
Is a kernel thread a process?A kernel thread is a kernel entity, like processes and interrupt handlers; it is the entity handled by the system scheduler. A kernel thread runs within a process, but can be referenced by any other thread in the system.
|