]>
git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/blob - include/linux/sched/rt.h
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _LINUX_SCHED_RT_H
3 #define _LINUX_SCHED_RT_H
5 #include <linux/sched.h>
9 static inline int rt_prio(int prio
)
11 if (unlikely(prio
< MAX_RT_PRIO
))
16 static inline int rt_task(struct task_struct
*p
)
18 return rt_prio(p
->prio
);
21 #ifdef CONFIG_RT_MUTEXES
23 * Must hold either p->pi_lock or task_rq(p)->lock.
25 static inline struct task_struct
*rt_mutex_get_top_task(struct task_struct
*p
)
27 return p
->pi_top_task
;
29 extern void rt_mutex_setprio(struct task_struct
*p
, struct task_struct
*pi_task
);
30 extern void rt_mutex_adjust_pi(struct task_struct
*p
);
31 static inline bool tsk_is_pi_blocked(struct task_struct
*tsk
)
33 return tsk
->pi_blocked_on
!= NULL
;
36 static inline struct task_struct
*rt_mutex_get_top_task(struct task_struct
*task
)
40 # define rt_mutex_adjust_pi(p) do { } while (0)
41 static inline bool tsk_is_pi_blocked(struct task_struct
*tsk
)
47 extern void normalize_rt_tasks(void);
51 * default timeslice is 100 msecs (used only for SCHED_RR tasks).
52 * Timeslices get refilled after they expire.
54 #define RR_TIMESLICE (100 * HZ / 1000)
56 #endif /* _LINUX_SCHED_RT_H */