From: Ingo Molnar Date: Mon, 15 Oct 2007 15:00:04 +0000 (+0200) Subject: sched: optimize vruntime based scheduling X-Git-Tag: v2.6.24-rc1~1289^2~121 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6cb58195143b55d4c427d92f8425bec2b0d9c56c;p=linux-2.6 sched: optimize vruntime based scheduling optimize vruntime based scheduling. Signed-off-by: Ingo Molnar Signed-off-by: Peter Zijlstra Signed-off-by: Mike Galbraith Reviewed-by: Thomas Gleixner --- diff --git a/kernel/sched.c b/kernel/sched.c index a5dd03522e..5594e65166 100644 --- a/kernel/sched.c +++ b/kernel/sched.c @@ -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; } diff --git a/kernel/sched_fair.c b/kernel/sched_fair.c index a566a45581..7041dc6978 100644 --- a/kernel/sched_fair.c +++ b/kernel/sched_fair.c @@ -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;