public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [RFC][PATCH 0/7] CGroup API: More structured API for CGroups control files
@ 2008-02-15 20:44 Paul Menage
  2008-02-15 20:44 ` [RFC][PATCH 1/7] CGroup API: Add cgroup.api control file Paul Menage
                   ` (7 more replies)
  0 siblings, 8 replies; 28+ messages in thread
From: Paul Menage @ 2008-02-15 20:44 UTC (permalink / raw)
  To: balbir, pj, Pavel Emelianov, KAMEZAWA Hiroyuki, vatsa, akpm
  Cc: containers, linux-kernel


This set of patches makes the Control Groups API more structured and
self-describing.

1) Allows control files to be associated with data types such as
"u64", "string", "map", etc. These types show up in a new cgroup.api
file in each cgroup directory, along with a user-readable
string. Files that use cgroup-provided data accessors have these file
types inferred automatically.

2) Moves various files in cpusets and the memory controller from using
custom-written file handlers to cgroup-defined handlers

3) Adds the "cgroup." prefix for existing cgroup-provided control
files (tasks, release_agent, releasable, notify_on_release). Given
than we've already had 2.6.24 go out without this prefix, I guess this
could be a little contentious - but it seems like a good move to
prevent name clashes in the future. (Note that this doesn't affect
mounting the legacy cpuset filesystem, since the compatibility layer
disables all prefixes when mounted with filesystem type "cpuset"). If
people object too strongly, we could just make this the case for *new*
cgroup API files, but I think this is a case where consistency would
be better than compatibility - I'd be surprised if anyone has written
major legacy apps yet that rely on 2.6.24 cgroup control file names.


There are various motivations for this:

1) We said at Kernel Summit '07 that the cgroup API wouldn't be
allowed to spiral into an arbitrary mess of ad-hoc APIs. Having simple
ways to represent common data types makes this easier. (E.g. one
standard way to report a map of string,u64 pairs to userspace.)

2) People were divided on the issue of binary APIs versus ASCII APIs
for control groups. Compatibility with the existing cpusets system,
and ease of experimentation, were two important reasons for going with
the current. ASCII API. But by having structured control files, we can
open the path towards having more efficient binary APIs for simpler
and more efficient programmatic access too, without any additional
modifications required from the subsystems themselves.

My plans for this potential binary API are a little hazy at this
point, but they might go something like opening a cgroup.bin file in a
cgroup directory, and writing the names of the control files that you
were interested in; then a read on that file handle would return the
contents of the given control files in a single read in a simple
binary format. (Better suggestions are welcome). Regardless, getting a
good typing/structure on the control files is an important first step
if we want to go in that direction.

3) The memory controller currently has files with the "_in_bytes"
suffix, on the grounds that otherwise it's not obvious to a new user
what they represent. By moving the description to a auto-generated API
file, we can remove this (IMO) inelegant suffix.


--

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

end of thread, other threads:[~2008-02-20  5:24 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-02-15 20:44 [RFC][PATCH 0/7] CGroup API: More structured API for CGroups control files Paul Menage
2008-02-15 20:44 ` [RFC][PATCH 1/7] CGroup API: Add cgroup.api control file Paul Menage
2008-02-16 10:07   ` Balbir Singh
2008-02-16 17:44     ` Paul Menage
2008-02-18  9:45       ` Li Zefan
2008-02-18 10:32         ` Balbir Singh
2008-02-19 21:57         ` Paul Jackson
2008-02-20  2:51           ` Paul Menage
2008-02-20  5:17             ` Paul Jackson
2008-02-20  5:23               ` Paul Menage
2008-02-20  2:51         ` Paul Menage
2008-02-15 20:44 ` [RFC][PATCH 2/7] CGroup API: Add cgroup map data type Paul Menage
2008-02-15 20:44 ` [RFC][PATCH 3/7] CGroup API: Use cgroup map for memcontrol stats file Paul Menage
2008-02-15 20:44 ` [RFC][PATCH 4/7] CGroup API: Add res_counter_read_uint() Paul Menage
2008-02-15 20:44 ` [RFC][PATCH 5/7] CGroup API: Use read_uint in memory controller Paul Menage
2008-02-15 20:44 ` [RFC][PATCH 6/7] CGroup API: Use descriptions for memory controller API files Paul Menage
2008-02-15 20:44 ` [RFC][PATCH 7/7] CGroup API: Update cpusets to use cgroup structured file API Paul Menage
2008-02-17  3:29   ` Paul Jackson
2008-02-17 17:18     ` Paul Menage
2008-02-17 17:28       ` Paul Jackson
2008-02-17 17:48         ` Paul Menage
2008-02-18  9:55     ` Li Zefan
     [not found]       ` <47B96805.7070002@linux.vnet.ibm.com>
2008-02-18 11:13         ` Balbir Singh
2008-02-18 11:52           ` Andreas Schwab
     [not found]             ` <47B971C6.4080807@linux.vnet.ibm.com>
2008-02-18 11:56               ` Balbir Singh
2008-02-16  4:21 ` [RFC][PATCH 0/7] CGroup API: More structured API for CGroups control files KAMEZAWA Hiroyuki
2008-02-16  9:31   ` Li Zefan
2008-02-16 17:40     ` Paul Menage

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox