public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Glauber Costa <glommer@parallels.com>
To: Tejun Heo <tj@kernel.org>
Cc: <linux-kernel@vger.kernel.org>,
	<containers@lists.linux-foundation.org>,
	<cgroups@vger.kernel.org>, <lizefan@huawei.com>,
	<peterz@infradead.org>, <mhocko@suse.cz>, <kay.sievers@vrfy.org>,
	<mzxreary@0pointer.de>, <davej@redhat.com>, <ben@decadent.org.uk>,
	<pjt@google.com>
Subject: Re: [PATCH 2/3] cgroup, sched: let cpu serve the same files as cpuacct
Date: Thu, 20 Sep 2012 12:05:10 +0400	[thread overview]
Message-ID: <505ACE36.80603@parallels.com> (raw)
In-Reply-To: <1348094625-4471-3-git-send-email-tj@kernel.org>

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.


  reply	other threads:[~2012-09-20  8:08 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-19 22:43 [PATCHSET RFC] cpu,cpuacct: make cpu serve cpuacct files and deprecate cpuacct Tejun Heo
2012-09-19 22:43 ` [PATCH 1/3] cgroup: implement CFTYPE_NO_PREFIX Tejun Heo
2012-09-19 22:43 ` [PATCH 2/3] cgroup, sched: let cpu serve the same files as cpuacct Tejun Heo
2012-09-20  8:05   ` Glauber Costa [this message]
2012-09-20 18:00     ` Tejun Heo
2012-09-19 22:43 ` [PATCH 3/3] cgroup, sched: deprecate cpuacct Tejun Heo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=505ACE36.80603@parallels.com \
    --to=glommer@parallels.com \
    --cc=ben@decadent.org.uk \
    --cc=cgroups@vger.kernel.org \
    --cc=containers@lists.linux-foundation.org \
    --cc=davej@redhat.com \
    --cc=kay.sievers@vrfy.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lizefan@huawei.com \
    --cc=mhocko@suse.cz \
    --cc=mzxreary@0pointer.de \
    --cc=peterz@infradead.org \
    --cc=pjt@google.com \
    --cc=tj@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox