cgroups.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCHSET RFC] cpu,cpuacct: make cpu serve cpuacct files and deprecate cpuacct
@ 2012-09-19 22:43 Tejun Heo
       [not found] ` <1348094625-4471-1-git-send-email-tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
  0 siblings, 1 reply; 6+ messages in thread
From: Tejun Heo @ 2012-09-19 22:43 UTC (permalink / raw)
  To: linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	cgroups-u79uwXL29TY76Z2rM5mHXA, lizefan-hv44wF8Li93QT0dZR+AlfA
  Cc: peterz-wEGCiKHe2LqWVfeAwA7xHQ, glommer-bzQdu9zFT3WakBO8gow8eQ,
	mhocko-AlSwsSmVLrQ, kay.sievers-tD+1rO4QERM,
	mzxreary-uLTowLwuiw4b1SvskN2V4Q, davej-H+wXaHxf7aLQT0dZR+AlfA,
	ben-/+tVBieCtBitmTQ+vhA3Yw, pjt-hpIqsD4AKlfQT0dZR+AlfA

Hello,

This is an attempt at allowing quick deprecation and removal of
cpuacct.  The patchset makes cpu serve the same cpuacct.* files and
updates cgroup core such that it ignores cpuacct if requested to be
co-mounted with cpu whether CONFIG_CGROUP_CPUACCT is enabled or not.

This de-couples cpuacct deprecation on kernel side from userland
transition as long as userland is co-mounting cpu and cpuacct.  In
this series, cpuacct implementation is simply copied into cpu, the
goal being to provide base for proper optimization (most likely
periodic collection of stats across the hierarchy).

I didn't try to maintain everything the same.  /proc/cgroups and
/proc/PID/cgroup may mis-represent or miss cpuacct entry.  Faking it
completely is doable too but I'd like to keep it as simple as
possible.

* If cpuacct is not used, nothing changes of course.

* If cpuacct is requested to be co-mounted with cpu, cpuacct is not
  used.  It doesn't matter whether CONFIG_CGROUP_CPUACCT is enabled or
  not.  cpu will provide cpusage.* statistics.

* If cpuacct is requested to be mounted separately and cpuacct is
  enabled, cgroup whines before mounting it.  If cpuacct is disabled,
  it fails.

I think the resulting behavior isn't too crazy and it should allow us
to remove anything cpuacct related fairly soon.

Longer term, I'd prefer to be able to drop the compatibility hack from
cgroup core too although I don't think that's too urgent.  I think
userland can either create symlinks for compatibility -
e.g. /sys/fs/cgroup/cpuacct and /sys/fs/cgroup/cpu,cpucct both
pointing to /sys/fs/cgroup/cpu - whether cpuacct exists or not, or
just ignore anything cpuacct related.

This series is based on for-3.7-hierarchy 8c7f6edbda0 ("cgroup: mark
subsystems with broken hierarchy...") and also available in the
following git branch.

 git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup.git review-deprecate-cpuacct

 include/linux/cgroup.h   |    1 
 init/Kconfig             |   11 ++
 kernel/cgroup.c          |   57 ++++++++++++-
 kernel/sched/core.c      |  196 ++++++++++++++++++++++++++++++++++++++++++++++-
 kernel/sched/fair.c      |    1 
 kernel/sched/rt.c        |    1 
 kernel/sched/sched.h     |    7 +
 kernel/sched/stop_task.c |    1 
 8 files changed, 269 insertions(+), 6 deletions(-)

Thanks.

--
tejun

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2012-09-20 18:00 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-19 22:43 [PATCHSET RFC] cpu,cpuacct: make cpu serve cpuacct files and deprecate cpuacct Tejun Heo
     [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
     [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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).