# 2025q1 Homework1 (ideas) contributed by <```Charlie-Tsai1123```> ## 從 CFS, EAS, 到 EEVDF : Kuanch, devarajabc #### CFS 1. "fairness" 依照權重分配 CPU (擁有最小 vruntime 先獲得 CPU) > under served : 擁有較小的 vruntime > cfs 只看得到 vruntime ![image](https://hackmd.io/_uploads/HkNp8xToye.png) 因為 A 是 0.8 (under served)所以先跑 A 額外的 0.25 秒,乘以權重後在加上先前跑得 0.8 vruntime ,全部都是 1 就符合 fairness 了 2. $Wall Time$ X $Weight$ = $vruntime$ 3. 為什麼被取代 - 如果權重太小會一質佔用 CPU - 高互動性任務需要頻繁使用 CPU #### EEVDF 1. 改用 deadline 隱含急迫性 (不但要公平還要關注如何使用) 2. CFS 注重 fairness ; EEVDF 注重 latency-nice ![image](https://hackmd.io/_uploads/ryavKe6j1x.png) 3. $vruntime$ + $Latency Nice$ = $deadline$ >如何決定 latency nice #### EAS 1. 並非排程,而是為 CPU 排程器提供評判「效率」的機制 2. 放在大核速度快但耗能高,小核反之 ## 還政於民的 sched_ext 及機器學習如何幫助 CPU 排程 : vax-r what is a schedulable unit? what are the workers? main job of CPU scheduler? >Task (sched_entity) >CPUs >Pick the best task. Pick the suitable CPU CPU load balance >在每個 CPU 平均分配任務 SCX >讓開發者可以實做 BPF scheduler >優勢:speed up the experiments procedure, customization, rapid scheduler deployments scx_lavd >讓互動性較高的優先被執行(編譯跟遊戲同時進行,讓遊戲不卡) Goal >藉由 ML 判斷是否要進行 task migration (imitate can_migrate_task in Linux Kernel) >關注在 kernel 有多快 困境 >難以創造 CPU load imbalance >解決: fio disk I/O task (但難以模仿真實狀況), CPU-bound task linux kernel compilation 結果 >Migration time 減少 >compile time 也減少 #### 問題 後面問題有點不懂為什麼 syncronous I/o, asyncronous I/O 會影響 CPU load balance