lkml.org 
[lkml]   [2008]   [Dec]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [patch] export percpu cpuacct cgroup stats

* Andrew Morton <akpm@linux-foundation.org> wrote:

> On Fri, 5 Dec 2008 10:16:30 -0800 Ken Chen <kenchen@google.com> wrote:
>
> > +static int cpuacct_percpu_seq_read(struct cgroup *cgroup, struct cftype *cft,
> > + struct seq_file *m)
> > +{
> > + struct cpuacct *ca = cgroup_ca(cgroup);
> > + u64 percpu;
> > + int i;
> > +
> > + for_each_possible_cpu(i) {
> > + spin_lock_irq(&cpu_rq(i)->lock);
> > + percpu = *percpu_ptr(ca->cpuusage, i);
> > + spin_unlock_irq(&cpu_rq(i)->lock);
> > + seq_printf(m, "%llu ", (unsigned long long) percpu);
> > + }
> > + seq_printf(m, "\n");
> > + return 0;
> > +}
>
> The locking is only needed for 32-bit, I assume?
>
> The iteration across all possible CPUs seems a bit lame - that code
> looks pretty easy to convert to hotplug goodness.
>
> (All of which pertains to existing code, not to this patch).

fair enough. Ken, would you mind updating it in this fashion?

Ingo


\
 
 \ /
  Last update: 2008-12-08 15:37    [W:0.085 / U:0.264 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site