OpenVZ Forum


Home » Mailing lists » Devel » [PATCH v3 0/6] per cgroup /proc/stat statistics
Re: [PATCH v3 6/6] expose per-taskgroup schedstats in cgroup [message #46621 is a reply to message #46603] Wed, 30 May 2012 11:22 Go to previous messageGo to previous message
Peter Zijlstra is currently offline  Peter Zijlstra
Messages: 61
Registered: September 2006
Member
On Wed, 2012-05-30 at 13:48 +0400, Glauber Costa wrote:
> +static u64 tg_idle(struct task_group *tg, int cpu)
> +{
> + u64 val;
> +
> + if (tg != &root_task_group) {
> + val = cfs_read_sleep(tg->se[cpu]);
> + /* If we have rt tasks running, we're not really idle */
> + val -= rt_rq(exec_clock, tg, cpu);
> + } else
> + /*
> + * There are many errors here that we are accumulating.
> + * However, we only provide this in the interest of having
> + * a consistent interface for all cgroups. Everybody
> + * probing the root cgroup should be getting its figures
> + * from system-wide files as /proc/stat. That would be faster
> + * to begin with...
> + *
> + * Ditto for steal.
> + */
> + val = kcpustat_cpu(cpu).cpustat[CPUTIME_IDLE] * TICK_NSEC;

You just violated 2 coding style rules in one go :-)

If one side of the if-else has braces, the other side should have too.
If a block is multi-line (regardless of multi-stmt) it should have
braces.

/me hands you a bucket full of {}.

> + return val;
> +}
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: [PATCH v3 2/6] account guest time per-cgroup as well.
Next Topic: [PATCH 0/2] NFS: callback shutdown panic fix
Goto Forum:
  


Current Time: Mon Sep 09 07:12:55 GMT 2024

Total time taken to generate the page: 0.04675 seconds