Skip to content

Commit

Permalink
sched: optimize vruntime based scheduling
Browse files Browse the repository at this point in the history
optimize vruntime based scheduling.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Mike Galbraith <efault@gmx.de>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
  • Loading branch information
Ingo Molnar committed Oct 15, 2007
1 parent bf5c91b commit 6cb5819
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 3 additions & 2 deletions kernel/sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -732,13 +732,14 @@ calc_delta_fair(unsigned long delta_exec, struct load_weight *lw)
static inline void update_load_add(struct load_weight *lw, unsigned long inc)
{
lw->weight += inc;
lw->inv_weight = WMULT_CONST / lw->weight;
if (sched_feat(FAIR_SLEEPERS))
lw->inv_weight = WMULT_CONST / lw->weight;
}

static inline void update_load_sub(struct load_weight *lw, unsigned long dec)
{
lw->weight -= dec;
if (likely(lw->weight))
if (sched_feat(FAIR_SLEEPERS) && likely(lw->weight))
lw->inv_weight = WMULT_CONST / lw->weight;
}

Expand Down
3 changes: 3 additions & 0 deletions kernel/sched_fair.c
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,9 @@ __update_curr(struct cfs_rq *cfs_rq, struct sched_entity *curr,
}
curr->vruntime += delta_exec_weighted;

if (!sched_feat(FAIR_SLEEPERS))
return;

if (unlikely(!load))
return;

Expand Down

0 comments on commit 6cb5819

Please sign in to comment.