Linux Container Development
 help / color / mirror / Atom feed
From: Glauber Costa <glommer-bzQdu9zFT3WakBO8gow8eQ@public.gmane.org>
To: Tejun Heo <tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Cc: pjt-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org,
	containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org,
	kay.sievers-tD+1rO4QERM@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	mhocko-AlSwsSmVLrQ@public.gmane.org,
	mzxreary-uLTowLwuiw4b1SvskN2V4Q@public.gmane.org,
	davej-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org,
	cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	ben-/+tVBieCtBitmTQ+vhA3Yw@public.gmane.org
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-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.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.

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

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1348094625-4471-1-git-send-email-tj@kernel.org>
     [not found] ` <1348094625-4471-1-git-send-email-tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
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
     [not found]     ` <1348094625-4471-3-git-send-email-tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2012-09-20  8:05       ` Glauber Costa [this message]
     [not found]         ` <505ACE36.80603-bzQdu9zFT3WakBO8gow8eQ@public.gmane.org>
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-bzqdu9zft3wakbo8gow8eq@public.gmane.org \
    --cc=ben-/+tVBieCtBitmTQ+vhA3Yw@public.gmane.org \
    --cc=cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org \
    --cc=davej-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=kay.sievers-tD+1rO4QERM@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=mhocko-AlSwsSmVLrQ@public.gmane.org \
    --cc=mzxreary-uLTowLwuiw4b1SvskN2V4Q@public.gmane.org \
    --cc=pjt-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org \
    --cc=tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.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