features.h 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * Only give sleepers 50% of their service deficit. This allows
  4. * them to run sooner, but does not allow tons of sleepers to
  5. * rip the spread apart.
  6. */
  7. SCHED_FEAT(GENTLE_FAIR_SLEEPERS, true)
  8. /*
  9. * Place new tasks ahead so that they do not starve already running
  10. * tasks
  11. */
  12. SCHED_FEAT(START_DEBIT, true)
  13. /*
  14. * Prefer to schedule the task we woke last (assuming it failed
  15. * wakeup-preemption), since its likely going to consume data we
  16. * touched, increases cache locality.
  17. */
  18. SCHED_FEAT(NEXT_BUDDY, false)
  19. /*
  20. * Prefer to schedule the task that ran last (when we did
  21. * wake-preempt) as that likely will touch the same data, increases
  22. * cache locality.
  23. */
  24. SCHED_FEAT(LAST_BUDDY, true)
  25. /*
  26. * Consider buddies to be cache hot, decreases the likelyness of a
  27. * cache buddy being migrated away, increases cache locality.
  28. */
  29. SCHED_FEAT(CACHE_HOT_BUDDY, true)
  30. /*
  31. * Allow wakeup-time preemption of the current task:
  32. */
  33. SCHED_FEAT(WAKEUP_PREEMPTION, true)
  34. SCHED_FEAT(HRTICK, false)
  35. SCHED_FEAT(DOUBLE_TICK, false)
  36. SCHED_FEAT(LB_BIAS, true)
  37. /*
  38. * Decrement CPU capacity based on time not spent running tasks
  39. */
  40. SCHED_FEAT(NONTASK_CAPACITY, true)
  41. /*
  42. * Queue remote wakeups on the target CPU and process them
  43. * using the scheduler IPI. Reduces rq->lock contention/bounces.
  44. */
  45. SCHED_FEAT(TTWU_QUEUE, true)
  46. /*
  47. * When doing wakeups, attempt to limit superfluous scans of the LLC domain.
  48. */
  49. SCHED_FEAT(SIS_AVG_CPU, false)
  50. SCHED_FEAT(SIS_PROP, true)
  51. /*
  52. * Issue a WARN when we do multiple update_rq_clock() calls
  53. * in a single rq->lock section. Default disabled because the
  54. * annotations are not complete.
  55. */
  56. SCHED_FEAT(WARN_DOUBLE_CLOCK, false)
  57. #ifdef HAVE_RT_PUSH_IPI
  58. /*
  59. * In order to avoid a thundering herd attack of CPUs that are
  60. * lowering their priorities at the same time, and there being
  61. * a single CPU that has an RT task that can migrate and is waiting
  62. * to run, where the other CPUs will try to take that CPUs
  63. * rq lock and possibly create a large contention, sending an
  64. * IPI to that CPU and let that CPU push the RT task to where
  65. * it should go may be a better scenario.
  66. */
  67. SCHED_FEAT(RT_PUSH_IPI, true)
  68. #endif
  69. SCHED_FEAT(RT_RUNTIME_SHARE, false)
  70. SCHED_FEAT(LB_MIN, false)
  71. SCHED_FEAT(ATTACH_AGE_LOAD, true)
  72. SCHED_FEAT(WA_IDLE, true)
  73. SCHED_FEAT(WA_WEIGHT, true)
  74. SCHED_FEAT(WA_BIAS, true)
  75. /*
  76. * UtilEstimation. Use estimated CPU utilization.
  77. */
  78. SCHED_FEAT(UTIL_EST, true)
  79. /*
  80. * HMP scheduling. Use dynamic threshold depends on system load and
  81. * CPU capacity to make schedule decisions.
  82. */
  83. #ifdef CONFIG_SCHED_HMP
  84. SCHED_FEAT(SCHED_HMP, true)
  85. #else
  86. SCHED_FEAT(SCHED_HMP, false)
  87. #endif
  88. /*
  89. * Energy aware scheduling. Use platform energy model to guide scheduling
  90. * decisions optimizing for energy efficiency.
  91. */
  92. #ifdef CONFIG_DEFAULT_USE_ENERGY_AWARE
  93. SCHED_FEAT(ENERGY_AWARE, true)
  94. #else
  95. SCHED_FEAT(ENERGY_AWARE, false)
  96. #endif
  97. /*
  98. * Energy aware scheduling algorithm choices:
  99. * EAS_PREFER_IDLE
  100. * Direct tasks in a schedtune.prefer_idle=1 group through
  101. * the EAS path for wakeup task placement. Otherwise, put
  102. * those tasks through the mainline slow path.
  103. * FIND_BEST_TARGET
  104. * Limit the number of placement options for which we calculate
  105. * energy by using heuristics to select 'best idle' and
  106. * 'best active' cpu options.
  107. * FBT_STRICT_ORDER
  108. * ON: If the target CPU saves any energy, use that.
  109. * OFF: Use whichever of target or backup saves most.
  110. */
  111. SCHED_FEAT(EAS_PREFER_IDLE, true)
  112. SCHED_FEAT(FIND_BEST_TARGET, true)
  113. SCHED_FEAT(FBT_STRICT_ORDER, false)
  114. SCHED_FEAT(SCHED_MTK_EAS, true)
  115. /*
  116. * Apply schedtune boost hold to tasks of all sched classes.
  117. * If enabled, schedtune will hold the boost applied to a CPU
  118. * for 50ms regardless of task activation - if the task is
  119. * still running 50ms later, the boost hold expires and schedtune
  120. * boost will expire immediately the task stops.
  121. * If disabled, this behaviour will only apply to tasks of the
  122. * RT class.
  123. */
  124. SCHED_FEAT(SCHEDTUNE_BOOST_HOLD_ALL, false)
  125. /*
  126. * Utilization clamping lazy update.
  127. */
  128. SCHED_FEAT(UCLAMP_LAZY_UPDATE, false)