deadline.h 652 B

12345678910111213141516171819202122232425262728293031323334
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * SCHED_DEADLINE tasks has negative priorities, reflecting
  4. * the fact that any of them has higher prio than RT and
  5. * NORMAL/BATCH tasks.
  6. */
  7. #define MAX_DL_PRIO 0
  8. static inline int dl_prio(int prio)
  9. {
  10. if (unlikely(prio < MAX_DL_PRIO))
  11. return 1;
  12. return 0;
  13. }
  14. static inline int dl_task(struct task_struct *p)
  15. {
  16. return dl_prio(p->prio);
  17. }
  18. static inline bool dl_time_before(u64 a, u64 b)
  19. {
  20. return (s64)(a - b) < 0;
  21. }
  22. #ifdef CONFIG_SMP
  23. struct root_domain;
  24. extern void dl_add_task_root_domain(struct task_struct *p);
  25. extern void dl_clear_root_domain(struct root_domain *rd);
  26. #endif /* CONFIG_SMP */