Special Processes

PID 0 - Swapper

  • 並不是由某個 file 載入的 process,而是 kernel 開機後直接創造的 process
  • 他負責進行 CPU scheduling 以及 memory management
  • 負責叫大範圍的 memory management,像是在 memory 不足時直接將兩小時沒用的 chrome 所佔據的 RAM 直接釋放

PID 1 - Init

  • 第一個 user space 的 process (擁有 superuser 權限)
  • 負責啟動各種 daemon (在背景運行的服務程序)
  • booting 筆記中 kernel 的第二到第四步驟
  • 我們用戶自己創造的 process 都會是 Init 的子嗣

PID 2 - Pagedaemon

  • 跟 swapper 一樣是 kernel process
  • 一樣是做 memory management,但是負責比較細緻的部分,它將不常用的 page 釋放 (4KB 為單位) 進行動態調整

Init 和 Pagedaemon 都是 Swapper 創造的 child process