Little cleanup.. Signed-off-by: Peter Zijlstra --- kernel/sched_fair.c | 44 +++++++++++++++++++++++++++++--------------- 1 file changed, 29 insertions(+), 15 deletions(-) Index: linux-2.6-2/kernel/sched_fair.c =================================================================== --- linux-2.6-2.orig/kernel/sched_fair.c +++ linux-2.6-2/kernel/sched_fair.c @@ -342,6 +342,34 @@ int sched_nr_latency_handler(struct ctl_ #endif /* + * delta *= w / rw + */ +static inline unsigned long +calc_delta_weight(unsigned long delta, struct sched_entity *se) +{ + for_each_sched_entity(se) { + delta = calc_delta_mine(delta, + se->load.weight, &cfs_rq_of(se)->load); + } + + return delta; +} + +/* + * delta *= rw / w + */ +static inline unsigned long +calc_delta_fair(unsigned long delta, struct sched_entity *se) +{ + for_each_sched_entity(se) { + delta = calc_delta_mine(delta, + cfs_rq_of(se)->load.weight, &se->load); + } + + return delta; +} + +/* * The idea is to set a period in which each task runs once. * * When there are too many tasks (sysctl_sched_nr_latency) we have to stretch @@ -379,10 +407,7 @@ static u64 sched_slice(struct cfs_rq *cf if (unlikely(rq_of(cfs_rq)->load.weight <= se->load.weight)) goto out; - for_each_sched_entity(se) { - slice = calc_delta_mine(slice, - se->load.weight, &cfs_rq_of(se)->load); - } + slice = calc_delta_weight(slice, se); out: return slice; @@ -403,17 +428,6 @@ static u64 sched_vslice_add(struct cfs_r return __sched_period(nr_running); } -static inline unsigned long -calc_delta_fair(unsigned long delta, struct sched_entity *se) -{ - for_each_sched_entity(se) { - delta = calc_delta_mine(delta, - cfs_rq_of(se)->load.weight, &se->load); - } - - return delta; -} - /* * The goal of calc_delta_asym() is to be asymmetrically around NICE_0_LOAD, in * that it favours >=0 over <0. -- -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/