deadline.h 678 B

123456789101112131415161718192021222324252627282930313233343536
  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. #include <linux/sched.h>
  8. #define MAX_DL_PRIO 0
  9. static inline int dl_prio(int prio)
  10. {
  11. if (unlikely(prio < MAX_DL_PRIO))
  12. return 1;
  13. return 0;
  14. }
  15. static inline int dl_task(struct task_struct *p)
  16. {
  17. return dl_prio(p->prio);
  18. }
  19. static inline bool dl_time_before(u64 a, u64 b)
  20. {
  21. return (s64)(a - b) < 0;
  22. }
  23. #ifdef CONFIG_SMP
  24. struct root_domain;
  25. extern void dl_add_task_root_domain(struct task_struct *p);
  26. extern void dl_clear_root_domain(struct root_domain *rd);
  27. #endif /* CONFIG_SMP */