Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

17.6 Idle Process Configuration

The technical objective of init_idle() is to formally flag the currently executing process (referenced via the global tracking macro current, which points to the active task_struct) as the dedicated idle process for the local CPU core. It associates this process with the idle pointer managed inside the CPU's local runqueue (struct rq), ensuring that whenever the processor core faces a total absence of runnable workloads, it automatically switches back to this thread to execute the "idle loop." The scheduling class of this idle process is explicitly configured to reference idle_sched_class, which represents the lowest-priority scheduling tier in the system; it gains execution boundaries only when all alternative scheduling tracks are empty.

The function idle_thread_set_boot_cpu() is primarily leveraged during system bootstrap or CPU hotplug events to register that the bootstrap CPU possesses a valid, fully tracking idle thread. It assigns the current task structure to a per-CPU tracking variable named idle_threads, thereby configuring the active initialization process (PID 0, known as the idle process) to serve as the baseline idle task for that processor core.

Copyright © 2026 Guangzhou eSmart Information Technology Co., Ltd. All Rights Reserved.
All content in this book is copyrighted by the author. For personal learning and exchange only. Commercial use without authorization is strictly prohibited. Email:

✉ 3348194517@qq.com | hai616878@gmail.com