Commit 6cb58195 authored by Ingo Molnar's avatar Ingo Molnar

sched: optimize vruntime based scheduling

optimize vruntime based scheduling.
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
Signed-off-by: default avatarPeter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: default avatarMike Galbraith <efault@gmx.de>
Reviewed-by: default avatarThomas Gleixner <tglx@linutronix.de>
parent bf5c91ba
...@@ -732,13 +732,14 @@ calc_delta_fair(unsigned long delta_exec, struct load_weight *lw) ...@@ -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) static inline void update_load_add(struct load_weight *lw, unsigned long inc)
{ {
lw->weight += inc; lw->weight += inc;
if (sched_feat(FAIR_SLEEPERS))
lw->inv_weight = WMULT_CONST / lw->weight; lw->inv_weight = WMULT_CONST / lw->weight;
} }
static inline void update_load_sub(struct load_weight *lw, unsigned long dec) static inline void update_load_sub(struct load_weight *lw, unsigned long dec)
{ {
lw->weight -= dec; lw->weight -= dec;
if (likely(lw->weight)) if (sched_feat(FAIR_SLEEPERS) && likely(lw->weight))
lw->inv_weight = WMULT_CONST / lw->weight; lw->inv_weight = WMULT_CONST / lw->weight;
} }
......
...@@ -336,6 +336,9 @@ __update_curr(struct cfs_rq *cfs_rq, struct sched_entity *curr, ...@@ -336,6 +336,9 @@ __update_curr(struct cfs_rq *cfs_rq, struct sched_entity *curr,
} }
curr->vruntime += delta_exec_weighted; curr->vruntime += delta_exec_weighted;
if (!sched_feat(FAIR_SLEEPERS))
return;
if (unlikely(!load)) if (unlikely(!load))
return; return;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment