Re: [PATCH] Add hierarchical accounting to cpu accounting controller

From: Paul Menage
Date: Thu Oct 23 2008 - 11:49:48 EST


On Wed, Oct 22, 2008 at 10:43 PM, Bharata B Rao
<bharata@xxxxxxxxxxxxxxxxxx> wrote:
> ---
> kernel/sched.c | 30 ++++++++++++++++++++++++------
> 1 file changed, 24 insertions(+), 6 deletions(-)
>
> --- a/kernel/sched.c
> +++ b/kernel/sched.c
> @@ -9131,10 +9131,15 @@ struct cpuacct {
> struct cgroup_subsys_state css;
> /* cpuusage holds pointer to a u64-type object on every cpu */
> u64 *cpuusage;
> + struct cpuacct *parent;
> };
>
> +static struct cpuacct init_cpuacct_group;

Why are you making the root state static?

> struct cgroup_subsys cpuacct_subsys;
>
> +#define for_each_cpuacct_group(ca) \
> + for (; ca; ca = ca->parent)
> +

This is only used once, so doesn't seem worth creating a new macro for.

>
> + if (cgrp->parent) {
> + ca->css.cgroup = cgrp;

The cgroup pointer in the css is maintained by cgroups - you don't
need to set it.

Paul
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/