diff options
author | Kirill Tkhai <ktkhai@parallels.com> | 2014-08-06 04:06:01 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2014-08-20 03:47:20 -0400 |
commit | f36c019c79edb3a89920afae1b2b45987af1a112 (patch) | |
tree | 7fcc40c94e81fdf5db5bbf5015912bbb08cf78ea /kernel/sched | |
parent | 8b06c55bdb8b402cb4814e83dc4b1cb245fcc9f5 (diff) |
sched/fair: Fix reschedule which is generated on throttled cfs_rq
(sched_entity::on_rq == 1) does not guarantee the task is pickable;
changes on throttled cfs_rq must not lead to reschedule.
Check for task_struct::on_rq instead.
Signed-off-by: Kirill Tkhai <ktkhai@parallels.com>
Signed-off-by: Peter Zijlstra <peterz@infradead.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Link: http://lkml.kernel.org/r/1407312361.8424.35.camel@tkhai
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'kernel/sched')
-rw-r--r-- | kernel/sched/fair.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 1413c44ce8a1..bc37bb97159f 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c | |||
@@ -7494,7 +7494,7 @@ static void task_fork_fair(struct task_struct *p) | |||
7494 | static void | 7494 | static void |
7495 | prio_changed_fair(struct rq *rq, struct task_struct *p, int oldprio) | 7495 | prio_changed_fair(struct rq *rq, struct task_struct *p, int oldprio) |
7496 | { | 7496 | { |
7497 | if (!p->se.on_rq) | 7497 | if (!p->on_rq) |
7498 | return; | 7498 | return; |
7499 | 7499 | ||
7500 | /* | 7500 | /* |
@@ -7550,15 +7550,15 @@ static void switched_from_fair(struct rq *rq, struct task_struct *p) | |||
7550 | */ | 7550 | */ |
7551 | static void switched_to_fair(struct rq *rq, struct task_struct *p) | 7551 | static void switched_to_fair(struct rq *rq, struct task_struct *p) |
7552 | { | 7552 | { |
7553 | struct sched_entity *se = &p->se; | ||
7554 | #ifdef CONFIG_FAIR_GROUP_SCHED | 7553 | #ifdef CONFIG_FAIR_GROUP_SCHED |
7554 | struct sched_entity *se = &p->se; | ||
7555 | /* | 7555 | /* |
7556 | * Since the real-depth could have been changed (only FAIR | 7556 | * Since the real-depth could have been changed (only FAIR |
7557 | * class maintain depth value), reset depth properly. | 7557 | * class maintain depth value), reset depth properly. |
7558 | */ | 7558 | */ |
7559 | se->depth = se->parent ? se->parent->depth + 1 : 0; | 7559 | se->depth = se->parent ? se->parent->depth + 1 : 0; |
7560 | #endif | 7560 | #endif |
7561 | if (!se->on_rq) | 7561 | if (!p->on_rq) |
7562 | return; | 7562 | return; |
7563 | 7563 | ||
7564 | /* | 7564 | /* |