[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <505ACE36.80603@parallels.com>
Date: Thu, 20 Sep 2012 12:05:10 +0400
From: Glauber Costa <glommer@...allels.com>
To: Tejun Heo <tj@...nel.org>
CC: <linux-kernel@...r.kernel.org>,
<containers@...ts.linux-foundation.org>, <cgroups@...r.kernel.org>,
<lizefan@...wei.com>, <peterz@...radead.org>, <mhocko@...e.cz>,
<kay.sievers@...y.org>, <mzxreary@...inter.de>, <davej@...hat.com>,
<ben@...adent.org.uk>, <pjt@...gle.com>
Subject: Re: [PATCH 2/3] cgroup, sched: let cpu serve the same files as cpuacct
On 09/20/2012 02:43 AM, Tejun Heo wrote:
> +
> +void task_group_charge(struct task_struct *tsk, u64 cputime)
> +{
> + struct task_group *tg;
> + int cpu = task_cpu(tsk);
> +
> + rcu_read_lock();
> +
> + tg = container_of(task_subsys_state(tsk, cpu_cgroup_subsys_id),
> + struct task_group, css);
> +
> + for (; tg; tg = tg->parent) {
> + u64 *cpuusage = per_cpu_ptr(tg->cpuusage, cpu);
> + *cpuusage += cputime;
> + }
> +
> + rcu_read_unlock();
> +}
> #endif /* CONFIG_CGROUP_SCHED */
The whole point of this merge is that this is not needed.
This information is already available from exec_clock for fair tasks.
for rt tasks, we have no exec clock, but do have a hierarchy walk a bit
below the current cpuacct charge, that can be used for that purpose.
--
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