lkml.org 
[lkml]   [2009]   [Mar]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH -tip] cpuacct: per-cgroup utime/stime statistics - v5
On Wed, Mar 25, 2009 at 08:48:03AM +0800, Li Zefan wrote:
> > cpuacct: Add stime and utime statistics
> >
> > Add per-cgroup cpuacct controller statistics like the system and user
> > time consumed by the group of tasks.
>
> Reviewed-by: Li Zefan <lizf@cn.fujitsu.com>

Thanks.

>
> except a bug below.
>
> > + for (i = 0; i < CPUACCT_STAT_NSTATS; i++)
> > + if (percpu_counter_init(&ca->cpustat[i], 0))
> > + goto out_free_counters;
> >
> > if (cgrp->parent)
> > ca->parent = cgroup_ca(cgrp->parent);
> >
> > return &ca->css;
> > +
> > +out_free_counters:
> > + i--;
> > + while (i-- >= 0)
> > + percpu_counter_destroy(&ca->cpustat[i]);
>
> replace "i--; while (i-- >=0)" to "while (--i >=0)", otherwise
> you'll be accessing ca->cpustat[-1].

Sorry about this. Posted the fixed version.

Regards,
Bharata.


\
 
 \ /
  Last update: 2009-03-25 05:43    [W:0.075 / U:0.744 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site