Re: [RFC PATCH 14/14] sched: implement usage tracking

From: Peter Zijlstra
Date: Thu Feb 16 2012 - 11:58:42 EST


On Wed, 2012-02-01 at 17:38 -0800, Paul Turner wrote:
> struct sched_avg {
> u64 runnable_avg_sum, runnable_avg_period;
> u64 last_runnable_update, decay_count;
> + u32 usage_avg_sum;

4 byte hole

> unsigned long load_avg_contrib;
>
> int contributes_blocked_load;
>};


A) Running/Runnable
- uses last_runnable_update to track
runnable_avg_sum, usage_avg_sum and runnable_avg_period

B) Blocked
- uses decay_count to keep track of sleeptime

C) 'Migrate'
- uses contributes_blocked_load to check if we actually did migrate?

So there's a number of things I don't get, why have
remove_task_load_avg_async() in set_task_rq()? enqueue_entity_load_avg()
can do the __synchronize_entity_decay() thing (and actually does) just
fine, right?

Similarly, why not use last_runnable_update (as last_update) to track
both A and B since a task cannot be in both states at the same time
anyway. If you always update the timestamp you can use it to either
track runnable/usage or decay for sleep.

That would get rid of decay_count and contributes_blocked_load, no?
--
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/