sched-eevdf.rst 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. ===============
  2. EEVDF Scheduler
  3. ===============
  4. The "Earliest Eligible Virtual Deadline First" (EEVDF) was first introduced
  5. in a scientific publication in 1995 [1]. The Linux kernel began
  6. transitioning to EEVDF in version 6.6 (as a new option in 2024), moving
  7. away from the earlier Completely Fair Scheduler (CFS) in favor of a version
  8. of EEVDF proposed by Peter Zijlstra in 2023 [2-4]. More information
  9. regarding CFS can be found in
  10. Documentation/scheduler/sched-design-CFS.rst.
  11. Similarly to CFS, EEVDF aims to distribute CPU time equally among all
  12. runnable tasks with the same priority. To do so, it assigns a virtual run
  13. time to each task, creating a "lag" value that can be used to determine
  14. whether a task has received its fair share of CPU time. In this way, a task
  15. with a positive lag is owed CPU time, while a negative lag means the task
  16. has exceeded its portion. EEVDF picks tasks with lag greater or equal to
  17. zero and calculates a virtual deadline (VD) for each, selecting the task
  18. with the earliest VD to execute next. It's important to note that this
  19. allows latency-sensitive tasks with shorter time slices to be prioritized,
  20. which helps with their responsiveness.
  21. There are ongoing discussions on how to manage lag, especially for sleeping
  22. tasks; but at the time of writing EEVDF uses a "decaying" mechanism based
  23. on virtual run time (VRT). This prevents tasks from exploiting the system
  24. by sleeping briefly to reset their negative lag: when a task sleeps, it
  25. remains on the run queue but marked for "deferred dequeue," allowing its
  26. lag to decay over VRT. Hence, long-sleeping tasks eventually have their lag
  27. reset. Finally, tasks can preempt others if their VD is earlier, and tasks
  28. can request specific time slices using the new sched_setattr() system call,
  29. which further facilitates the job of latency-sensitive applications.
  30. REFERENCES
  31. ==========
  32. [1] https://citeseerx.ist.psu.edu/document?repid=rep1&type=pdf&doi=805acf7726282721504c8f00575d91ebfd750564
  33. [2] https://lore.kernel.org/lkml/a79014e6-ea83-b316-1e12-2ae056bda6fa@linux.vnet.ibm.com/
  34. [3] https://lwn.net/Articles/969062/
  35. [4] https://lwn.net/Articles/925371/