lkml.org 
[lkml]   [2012]   [Mar]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [RFC PATCH 14/14] sched: implement usage tracking
From
On 14 March 2012 16:01, Peter Zijlstra <a.p.zijlstra@chello.nl> wrote:
>
> On Tue, 2012-03-13 at 17:57 +0100, Vincent Guittot wrote:
> > >  struct sched_avg {
> > >        u64 runnable_avg_sum, runnable_avg_period;
> > >        u64 last_runnable_update, decay_count;
> > > +       u32 usage_avg_sum;
> >
> > Why usage_avg_sum is 32bits whereas runnable_avg_sum and
> > runnable_avg_period are 64bits long ? You are doing the same
> > computation on these 3 variables. Only the computation need to be done
> > in 64bits but the result could be saved in 32bits ?
>
> Since you can never use more than 100% of cpu time, usage_avg_sum is
> bound to 100% of the period, which (assuming your period < ~4s) should
> thus still fit in the ~4s u32 provides.
>
> Runnable otoh is not bound by that and thus we cannot guarantee the
> value stays within the ~4s value range.

Shouldn't usage_avg_sum and runnable_avg_sum be equal for rq because
running and runnable parameters are equals and we have the same
computation ?

Furthermore, the geometric series should ensure us that final value
shouldn't be larger than 1024/(1-y) which is around 47000
--
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/

\
 
 \ /
  Last update: 2012-03-14 16:55    [W:0.379 / U:0.020 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site