How kernel reacts when cpu is high

Not Just Restart
1 min readFeb 4, 2023

CPU Scheduling:

The kernel employs a scheduler to determine which processes should run on the CPU. The scheduler uses various algorithms, such as the Completely Fair Scheduler (CFS) in modern Linux kernels, to ensure that processes receive a fair share of CPU time and prevent any one process from monopolizing the CPU.

Process Management:

When a process becomes CPU-bound and starts using an excessive amount of CPU resources, the kernel may intervene by lowering the priority of that process, temporarily suspending it, or killing it, depending on the specific configuration and the nature of the process.

Resource Limiting:

The kernel may enforce resource limits, such as maximum CPU usage or maximum resident memory usage, on individual processes or groups of processes to prevent them from consuming too many system resources and impacting the performance of other processes.

Throttling:

The kernel may dynamically adjust the CPU frequency or voltage to reduce the overall CPU utilization and prevent thermal issues or energy consumption.

Note that these actions are performed dynamically by the kernel based on the state of the system and the specific configurations in place. The exact sequence and methods may vary depending on the specific Linux distribution and the available hardware resources.

--

--