lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Sat, 25 Oct 2008 08:38:52 -0700
From:	"Paul Menage" <menage@...gle.com>
To:	bharata@...ux.vnet.ibm.com
Cc:	linux-kernel@...r.kernel.org,
	"Srivatsa Vaddagiri" <vatsa@...ux.vnet.ibm.com>,
	"Peter Zijlstra" <a.p.zijlstra@...llo.nl>,
	"Ingo Molnar" <mingo@...e.hu>
Subject: Re: [PATCH] Add hierarchical accounting to cpu accounting controller

On Fri, Oct 24, 2008 at 11:01 PM, Bharata B Rao
<bharata@...ux.vnet.ibm.com> wrote:
>
> Reported-by: Srivatsa Vaddagiri <vatsa@...ux.vnet.ibm.com>
> Signed-off-by: Bharata B Rao <bharata@...ux.vnet.ibm.com>

Reviewed-by: Paul Menage <menage@...gle.com>

So in technical terms this patch looks fine now. There's still the
question of whether it's OK to change the existing API, since it's
been in the kernel in its currently (non-hierarchical) form for
several releases now.

> CC: Peter Zijlstra <a.p.zijlstra@...llo.nl>
> CC: Ingo Molnar <mingo@...e.hu>
> CC: Paul Menage <menage@...gle.com>
> CC: Srivatsa Vaddagiri <vatsa@...ux.vnet.ibm.com>
> ---
>  kernel/sched.c |   10 ++++++++--
>  1 file changed, 8 insertions(+), 2 deletions(-)
>
> --- a/kernel/sched.c
> +++ b/kernel/sched.c
> @@ -9131,6 +9131,7 @@ struct cpuacct {
>        struct cgroup_subsys_state css;
>        /* cpuusage holds pointer to a u64-type object on every cpu */
>        u64 *cpuusage;
> +       struct cpuacct *parent;
>  };
>
>  struct cgroup_subsys cpuacct_subsys;
> @@ -9164,6 +9165,9 @@ static struct cgroup_subsys_state *cpuac
>                return ERR_PTR(-ENOMEM);
>        }
>
> +       if (cgrp->parent)
> +               ca->parent = cgroup_ca(cgrp->parent);
> +
>        return &ca->css;
>  }
>
> @@ -9243,14 +9247,16 @@ static int cpuacct_populate(struct cgrou
>  static void cpuacct_charge(struct task_struct *tsk, u64 cputime)
>  {
>        struct cpuacct *ca;
> +       int cpu;
>
>        if (!cpuacct_subsys.active)
>                return;
>
> +       cpu = task_cpu(tsk);
>        ca = task_ca(tsk);
> -       if (ca) {
> -               u64 *cpuusage = percpu_ptr(ca->cpuusage, task_cpu(tsk));
>
> +       for (; ca; ca = ca->parent) {
> +               u64 *cpuusage = percpu_ptr(ca->cpuusage, cpu);
>                *cpuusage += cputime;
>        }
>  }
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ