]>
git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blob - include/linux/sched/rt.h
5 * Priority of a process goes from 0..MAX_PRIO-1, valid RT
6 * priority is 0..MAX_RT_PRIO-1, and SCHED_NORMAL/SCHED_BATCH
7 * tasks are in the range MAX_RT_PRIO..MAX_PRIO-1. Priority
8 * values are inverted: lower p->prio value means higher priority.
10 * The MAX_USER_RT_PRIO value allows the actual maximum
11 * RT priority to be separate from the value exported to
12 * user-space. This allows kernel threads to set their
13 * priority to a value higher than any user task. Note:
14 * MAX_RT_PRIO must not be smaller than MAX_USER_RT_PRIO.
17 #define MAX_USER_RT_PRIO 100
18 #define MAX_RT_PRIO MAX_USER_RT_PRIO
20 #define MAX_PRIO (MAX_RT_PRIO + 40)
21 #define DEFAULT_PRIO (MAX_RT_PRIO + 20)
23 static inline int rt_prio(int prio
)
25 if (unlikely(prio
< MAX_RT_PRIO
))
30 static inline int rt_task(struct task_struct
*p
)
32 return rt_prio(p
->prio
);
35 #ifdef CONFIG_RT_MUTEXES
36 extern int rt_mutex_getprio(struct task_struct
*p
);
37 extern void rt_mutex_setprio(struct task_struct
*p
, int prio
);
38 extern struct task_struct
*rt_mutex_get_top_task(struct task_struct
*task
);
39 extern void rt_mutex_adjust_pi(struct task_struct
*p
);
40 static inline bool tsk_is_pi_blocked(struct task_struct
*tsk
)
42 return tsk
->pi_blocked_on
!= NULL
;
45 static inline int rt_mutex_getprio(struct task_struct
*p
)
47 return p
->normal_prio
;
49 static inline struct task_struct
*rt_mutex_get_top_task(struct task_struct
*task
)
53 # define rt_mutex_adjust_pi(p) do { } while (0)
54 static inline bool tsk_is_pi_blocked(struct task_struct
*tsk
)
60 extern void normalize_rt_tasks(void);
64 * default timeslice is 100 msecs (used only for SCHED_RR tasks).
65 * Timeslices get refilled after they expire.
67 #define RR_TIMESLICE (100 * HZ / 1000)
69 #endif /* _SCHED_RT_H */