MLFQ ưu tiên interactive processes bằng cách tự động hạ priority của CPU-bound tasks; Linux CFS thay thế MLFQ bằng vruntime tracking để đảm bảo công bằng mà vẫn ưu tiên interactive.
MLFQ: nhiều queue với priority khác nhau (Q0 highest priority, Q_n lowest). Rules: process mới vào Q0 (highest); nếu dùng hết time quantum → demote xuống queue thấp hơn (CPU-bound); nếu yield trước hết quantum (I/O-bound) → giữ hoặc promote; priority boost định kỳ (tất cả lên Q0) để tránh starvation. Kết quả: interactive processes (editor, browser) luôn responsive; CPU-bound background tasks chạy khi không có interactive job. Linux CFS (Completely Fair Scheduler): không dùng fixed time quantum — track vruntime (virtual runtime) của mỗi process, chọn process có vruntime nhỏ nhất để chạy tiếp. Process I/O-bound có vruntime nhỏ (ít chạy) → được ưu tiên cao khi wakeup. Nice value (-20 đến +19) tăng/giảm vruntime growth rate. Real-time scheduling: SCHED_FIFO, SCHED_RR cho realtime processes — preempt CFS processes. Practical: nice, renice command điều chỉnh priority; chrt set realtime policy; container CPU limits dùng CFS bandwidth controller (cpu.cfs_quota_us).
MLFQ prioritizes interactive processes by automatically lowering the priority of CPU-bound tasks; Linux CFS replaces MLFQ with vruntime tracking to ensure fairness while still favoring interactive workloads.
MLFQ: multiple queues with different priorities (Q0 = highest, Q_n = lowest). Rules: new processes enter Q0 (highest priority); if a process uses its full time quantum → demoted to a lower queue (CPU-bound behavior); if it yields before the quantum ends (I/O-bound behavior) → stays or is promoted; periodic priority boost (all processes moved back to Q0) prevents starvation. Result: interactive processes (editors, browsers) stay responsive; CPU-bound background jobs run when no interactive tasks are ready. Linux CFS (Completely Fair Scheduler): does not use fixed time quanta — tracks each process's vruntime (virtual runtime) and always runs the process with the smallest vruntime. I/O-bound processes have small vruntimes (they rarely run) → they get high priority when they wake up. The nice value (-20 to +19) scales the vruntime growth rate. Real-time scheduling: SCHED_FIFO and SCHED_RR for real-time processes — they preempt CFS processes. Practical: nice, renice adjust priority; chrt sets the real-time policy; container CPU limits use the CFS bandwidth controller (cpu.cfs_quota_us).