contributed by < linhoward0522 >
:::info
返回「Linux 核心專題: CPU 排程器研究」
:::
1 Basics of the Linux Kernel
1.1 Operating Systems
作業系統被視為使用者與底層硬體之間的協調者,其中排程器更是其核心所在。作業系統的工作包含管理硬體資源以及應用程式,作業系統的核心可以使用特權指令,讓每個程式能夠安全的獨立運行。而作業系統的實際責任是什麽? Linus Torvalds 說:「作業系統唯一的任務是要幫助程式運行,作業系統等著程式向它請求資源。」
Jim Huang changed 2 years agoView mode Like Bookmark
Explain the behavior of BORE
Burst-Oriented Response Enhancer (BORE) is enhanced versions of CFS (Completely Fair Scheduler) and EEVDF (Earliest Eligible Virtual Dealine First) Linux schedulers. It aims to maintain high performance while providing responsive user experience under versatile load scenarios.
BORE introduces "burstiness", a metric based on the accumulated CPU time of a task after explicitly relinquishing it. Departing partially from the CFS's "complete fairness" principle, BORE adjusts scheduling properties such as weights and delays for each task by dynamically adjusting their vruntime. This adjustment results in CPU-bound tasks having a higher vruntime compared to the CFS scheduler, giving preference to interactive tasks. BORE strikes a balance between CPU-bound and interactive tasks, enhancing the user experience by providing a more responsive system when different workloads coexist.
The main implementation of BORE is found in the scheduler routine called "update_curr" . This routine is responsible for updating the actual execution time and vruntime of the currently running task on the CPU.
update_curr
@@ -905,6 +1005,14 @@ static void update_curr(struct cfs_rq *cfs_rq)
curr->sum_exec_runtime += delta_exec;
linhoward0522 changed 2 years agoView mode Like Bookmark
contributed by < linhoward0522 >
開發環境
$ gcc --version
gcc (Ubuntu 11.3.0-1ubuntu1~22.04) 11.3.0
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
$ lscpu
linhoward0522 changed 2 years agoView mode Like Bookmark
contributed by < linhoward0522 >
開發環境
$ gcc --version
gcc (Ubuntu 11.3.0-1ubuntu1~22.04) 11.3.0
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
$ lscpu
linhoward0522 changed 2 years agoView mode Like Bookmark