lkml.org 
[lkml]   [2010]   [Oct]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v3 2/7] sched: accumulate per-cfs_rq cpu usage
From
Date
On Tue, 2010-10-12 at 13:21 +0530, Bharata B Rao wrote:
> +static void account_cfs_rq_quota(struct cfs_rq *cfs_rq,
> + unsigned long delta_exec)
> +{
> + if (cfs_rq->quota_assigned == RUNTIME_INF)
> + return;
> +
> + cfs_rq->quota_used += delta_exec;
> +
> + if (cfs_rq->quota_used < cfs_rq->quota_assigned)
> + return;
> +
> + cfs_rq->quota_assigned += tg_request_cfs_quota(cfs_rq->tg);
> +}

That looks iffy, quota_assigned is only ever incremented and can wrap.
Why not subtract delta_exec and replenish when <0? That keeps the
numbers small.


\
 
 \ /
  Last update: 2010-10-14 11:05    [W:1.239 / U:0.028 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site