diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2014-02-07 14:58:42 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2014-02-22 12:10:04 -0500 |
commit | c365c292d05908c6ea6f32708f331e21033fe71d (patch) | |
tree | fcaf27f6d0296ef48203f940d1ed9d8c02c56860 /include/linux/sched | |
parent | 81a44c5441d7f7d2c3dc9105f4d65ad0d5818617 (diff) |
sched: Consider pi boosting in setscheduler()
If a PI boosted task policy/priority is modified by a setscheduler()
call we unconditionally dequeue and requeue the task if it is on the
runqueue even if the new priority is lower than the current effective
boosted priority. This can result in undesired reordering of the
priority bucket list.
If the new priority is less or equal than the current effective we
just store the new parameters in the task struct and leave the
scheduler class and the runqueue untouched. This is handled when the
task deboosts itself. Only if the new priority is higher than the
effective boosted priority we apply the change immediately.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
[ Rebase ontop of v3.14-rc1. ]
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: Dario Faggioli <raistlin@linux.it>
Signed-off-by: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/1391803122-4425-7-git-send-email-bigeasy@linutronix.de
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'include/linux/sched')
-rw-r--r-- | include/linux/sched/rt.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/linux/sched/rt.h b/include/linux/sched/rt.h index f7453d4c5613..6341f5be6e24 100644 --- a/include/linux/sched/rt.h +++ b/include/linux/sched/rt.h | |||
@@ -18,6 +18,7 @@ static inline int rt_task(struct task_struct *p) | |||
18 | #ifdef CONFIG_RT_MUTEXES | 18 | #ifdef CONFIG_RT_MUTEXES |
19 | extern int rt_mutex_getprio(struct task_struct *p); | 19 | extern int rt_mutex_getprio(struct task_struct *p); |
20 | extern void rt_mutex_setprio(struct task_struct *p, int prio); | 20 | extern void rt_mutex_setprio(struct task_struct *p, int prio); |
21 | extern int rt_mutex_check_prio(struct task_struct *task, int newprio); | ||
21 | extern struct task_struct *rt_mutex_get_top_task(struct task_struct *task); | 22 | extern struct task_struct *rt_mutex_get_top_task(struct task_struct *task); |
22 | extern void rt_mutex_adjust_pi(struct task_struct *p); | 23 | extern void rt_mutex_adjust_pi(struct task_struct *p); |
23 | static inline bool tsk_is_pi_blocked(struct task_struct *tsk) | 24 | static inline bool tsk_is_pi_blocked(struct task_struct *tsk) |
@@ -29,6 +30,12 @@ static inline int rt_mutex_getprio(struct task_struct *p) | |||
29 | { | 30 | { |
30 | return p->normal_prio; | 31 | return p->normal_prio; |
31 | } | 32 | } |
33 | |||
34 | static inline int rt_mutex_check_prio(struct task_struct *task, int newprio) | ||
35 | { | ||
36 | return 0; | ||
37 | } | ||
38 | |||
32 | static inline struct task_struct *rt_mutex_get_top_task(struct task_struct *task) | 39 | static inline struct task_struct *rt_mutex_get_top_task(struct task_struct *task) |
33 | { | 40 | { |
34 | return NULL; | 41 | return NULL; |