diff options
author | Peter Zijlstra <a.p.zijlstra@chello.nl> | 2008-02-29 15:21:01 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-03-07 16:42:59 +0100 |
commit | 810b38179e9e4d4f57b4b733767bb08f8291a965 (patch) | |
tree | 91692de4fbd46879b29d803839b5bf7e25f30cd8 /kernel/sched_fair.c | |
parent | ce4796d1e16cf3761dc2a02b8d588667d05b3078 (diff) | |
download | linux-810b38179e9e4d4f57b4b733767bb08f8291a965.tar.gz linux-810b38179e9e4d4f57b4b733767bb08f8291a965.tar.bz2 linux-810b38179e9e4d4f57b4b733767bb08f8291a965.zip |
sched: retain vruntime
Kei Tokunaga reported an interactivity problem when moving tasks
between control groups.
Tasks would retain their old vruntime when moved between groups, this
can cause funny lags. Re-set the vruntime on group move to fit within
the new tree.
Reported-by: Kei Tokunaga <tokunaga.keiich@jp.fujitsu.com>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/sched_fair.c')
-rw-r--r-- | kernel/sched_fair.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/kernel/sched_fair.c b/kernel/sched_fair.c index 3df4d46994ca..e2a530515619 100644 --- a/kernel/sched_fair.c +++ b/kernel/sched_fair.c @@ -1353,6 +1353,16 @@ static void set_curr_task_fair(struct rq *rq) set_next_entity(cfs_rq_of(se), se); } +#ifdef CONFIG_FAIR_GROUP_SCHED +static void moved_group_fair(struct task_struct *p) +{ + struct cfs_rq *cfs_rq = task_cfs_rq(p); + + update_curr(cfs_rq); + place_entity(cfs_rq, &p->se, 1); +} +#endif + /* * All the scheduling class methods: */ @@ -1381,6 +1391,10 @@ static const struct sched_class fair_sched_class = { .prio_changed = prio_changed_fair, .switched_to = switched_to_fair, + +#ifdef CONFIG_FAIR_GROUP_SCHED + .moved_group = moved_group_fair, +#endif }; #ifdef CONFIG_SCHED_DEBUG |