Re: [patch 13/16] sched: update_cfs_shares at period edge

From: Paul Turner
Date: Tue Oct 02 2012 - 17:11:33 EST


On Mon, Sep 24, 2012 at 12:51 PM, "Jan H. Schönherr"
<schnhrr@xxxxxxxxxxxxxxx> wrote:
> Am 23.08.2012 16:14, schrieb pjt@xxxxxxxxxx:
>> From: Paul Turner <pjt@xxxxxxxxxx>
>>
>> Now that our measurement intervals are small (~1ms) we can amortize the posting
>> of update_shares() to be about each period overflow. This is a large cost
>> saving for frequently switching tasks.
>
> [snip]
>
>> @@ -1181,6 +1181,7 @@ static void update_cfs_rq_blocked_load(struct cfs_rq *cfs_rq, int force_update)
>> }
>>
>> __update_cfs_rq_tg_load_contrib(cfs_rq, force_update);
>> + update_cfs_shares(cfs_rq);
>> }
>
> Here a call to update_cfs_shares() gets added. Doesn't that make the call to
> update_cfs_shares() in __update_blocked_averages_cpu() superfluous?

Yes -- updated, Thanks.

>
>
> Function pasted here for reference:
>
> static void __update_blocked_averages_cpu(struct task_group *tg, int cpu)
> {
> struct sched_entity *se = tg->se[cpu];
> struct cfs_rq *cfs_rq = tg->cfs_rq[cpu];
>
> /* throttled entities do not contribute to load */
> if (throttled_hierarchy(cfs_rq))
> return;
>
> update_cfs_rq_blocked_load(cfs_rq, 1);
>
> if (se) {
> update_entity_load_avg(se, 1);
> /*
> * We can pivot on the runnable average decaying to zero for
> * list removal since the parent average will always be >=
> * child.
> */
> if (se->avg.runnable_avg_sum)
> update_cfs_shares(cfs_rq);
> else
> list_del_leaf_cfs_rq(cfs_rq);
> } else {
> struct rq *rq = rq_of(cfs_rq);
> update_rq_runnable_avg(rq, rq->nr_running);
> }
> }
>
>
> Regards
> Jan
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/