All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Update documentation of cgroups tasks and procs files
@ 2009-09-24  0:12 Paul Menage
  0 siblings, 0 replies; 4+ messages in thread
From: Paul Menage @ 2009-09-24  0:12 UTC (permalink / raw)
  To: akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b
  Cc: containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA


Update documentation of cgroups tasks and procs files

Document the cgroup.procs file.

Clarify the semantics of the cgroup.procs and tasks files.  Although
the current cgroup.procs interface returns a sorted and uniqified list
of pids, potential future performance enhancements could result in
those properties being removed - explicitly document this aspect of
the API.

There are no existing users of cgroup.procs, so compatibility isn't an
issue.  There are users of the "tasks" file, but none that would
appear to break in the event of the sorted property being broken. The
standard "libcpuset" explicitly sorts the results of reading from the
tasks file, and "libcg" and other users don't appear to care about
ordering.

Signed-off-by: Paul Menage <menage-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>

---

 Documentation/cgroups/cgroups.txt |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/Documentation/cgroups/cgroups.txt b/Documentation/cgroups/cgroups.txt
index d5be8ae..20face8 100644
--- a/Documentation/cgroups/cgroups.txt
+++ b/Documentation/cgroups/cgroups.txt
@@ -227,7 +227,14 @@ as the path relative to the root of the cgroup file system.
 Each cgroup is represented by a directory in the cgroup file system
 containing the following files describing that cgroup:
 
- - tasks: list of tasks (by pid) attached to that cgroup
+ - tasks: list of tasks (by pid) attached to that cgroup.  This list
+   is not guaranteed to be sorted.  Writing a thread id into this file
+   moves the thread into this cgroup.
+ - cgroup.procs: list of tgids in the cgroup.  This list is not
+   guaranteed to be sorted or free of duplicate tgids, and userspace
+   should sort/uniquify the list if this property is required.
+   Writing a tgid into this file moves all threads with that tgid into
+   this cgroup.
  - notify_on_release flag: run the release agent on exit?
  - release_agent: the path to use for release notifications (this file
    exists in the top cgroup only)
@@ -374,7 +381,7 @@ Now you want to do something with this cgroup.
 
 In this directory you can find several files:
 # ls
-notify_on_release tasks
+cgroup.procs notify_on_release tasks
 (plus whatever files added by the attached subsystems)
 
 Now attach your shell to this cgroup:

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

* Re: [PATCH] Update documentation of cgroups tasks and procs files
       [not found] ` <20090924001249.4783.91619.stgit-u3IScbYxn0zHt/MElyovVYaSKrA+ACpX0E9HWUfgJXw@public.gmane.org>
@ 2009-09-24  0:43   ` Li Zefan
  0 siblings, 0 replies; 4+ messages in thread
From: Li Zefan @ 2009-09-24  0:43 UTC (permalink / raw)
  To: Paul Menage
  Cc: akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b,
	containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA

Paul Menage wrote:
> Update documentation of cgroups tasks and procs files
> 
> Document the cgroup.procs file.
> 
> Clarify the semantics of the cgroup.procs and tasks files.  Although
> the current cgroup.procs interface returns a sorted and uniqified list
> of pids, potential future performance enhancements could result in
> those properties being removed - explicitly document this aspect of
> the API.
> 
> There are no existing users of cgroup.procs, so compatibility isn't an
> issue.  There are users of the "tasks" file, but none that would
> appear to break in the event of the sorted property being broken. The
> standard "libcpuset" explicitly sorts the results of reading from the
> tasks file, and "libcg" and other users don't appear to care about
> ordering.
> 
> Signed-off-by: Paul Menage <menage-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
> 

Reviewed-by: Li Zefan <lizf-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org>

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

* Re: [PATCH] Update documentation of cgroups tasks and procs files
  2009-09-24  0:12 Paul Menage
       [not found] ` <20090924001249.4783.91619.stgit-u3IScbYxn0zHt/MElyovVYaSKrA+ACpX0E9HWUfgJXw@public.gmane.org>
@ 2009-09-24  0:43 ` Li Zefan
  1 sibling, 0 replies; 4+ messages in thread
From: Li Zefan @ 2009-09-24  0:43 UTC (permalink / raw)
  To: Paul Menage; +Cc: akpm, containers, linux-kernel

Paul Menage wrote:
> Update documentation of cgroups tasks and procs files
> 
> Document the cgroup.procs file.
> 
> Clarify the semantics of the cgroup.procs and tasks files.  Although
> the current cgroup.procs interface returns a sorted and uniqified list
> of pids, potential future performance enhancements could result in
> those properties being removed - explicitly document this aspect of
> the API.
> 
> There are no existing users of cgroup.procs, so compatibility isn't an
> issue.  There are users of the "tasks" file, but none that would
> appear to break in the event of the sorted property being broken. The
> standard "libcpuset" explicitly sorts the results of reading from the
> tasks file, and "libcg" and other users don't appear to care about
> ordering.
> 
> Signed-off-by: Paul Menage <menage@google.com>
> 

Reviewed-by: Li Zefan <lizf@cn.fujitsu.com>

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

* [PATCH] Update documentation of cgroups tasks and procs files
@ 2009-09-24  0:12 Paul Menage
       [not found] ` <20090924001249.4783.91619.stgit-u3IScbYxn0zHt/MElyovVYaSKrA+ACpX0E9HWUfgJXw@public.gmane.org>
  2009-09-24  0:43 ` Li Zefan
  0 siblings, 2 replies; 4+ messages in thread
From: Paul Menage @ 2009-09-24  0:12 UTC (permalink / raw)
  To: akpm; +Cc: containers, linux-kernel


Update documentation of cgroups tasks and procs files

Document the cgroup.procs file.

Clarify the semantics of the cgroup.procs and tasks files.  Although
the current cgroup.procs interface returns a sorted and uniqified list
of pids, potential future performance enhancements could result in
those properties being removed - explicitly document this aspect of
the API.

There are no existing users of cgroup.procs, so compatibility isn't an
issue.  There are users of the "tasks" file, but none that would
appear to break in the event of the sorted property being broken. The
standard "libcpuset" explicitly sorts the results of reading from the
tasks file, and "libcg" and other users don't appear to care about
ordering.

Signed-off-by: Paul Menage <menage@google.com>

---

 Documentation/cgroups/cgroups.txt |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/Documentation/cgroups/cgroups.txt b/Documentation/cgroups/cgroups.txt
index d5be8ae..20face8 100644
--- a/Documentation/cgroups/cgroups.txt
+++ b/Documentation/cgroups/cgroups.txt
@@ -227,7 +227,14 @@ as the path relative to the root of the cgroup file system.
 Each cgroup is represented by a directory in the cgroup file system
 containing the following files describing that cgroup:
 
- - tasks: list of tasks (by pid) attached to that cgroup
+ - tasks: list of tasks (by pid) attached to that cgroup.  This list
+   is not guaranteed to be sorted.  Writing a thread id into this file
+   moves the thread into this cgroup.
+ - cgroup.procs: list of tgids in the cgroup.  This list is not
+   guaranteed to be sorted or free of duplicate tgids, and userspace
+   should sort/uniquify the list if this property is required.
+   Writing a tgid into this file moves all threads with that tgid into
+   this cgroup.
  - notify_on_release flag: run the release agent on exit?
  - release_agent: the path to use for release notifications (this file
    exists in the top cgroup only)
@@ -374,7 +381,7 @@ Now you want to do something with this cgroup.
 
 In this directory you can find several files:
 # ls
-notify_on_release tasks
+cgroup.procs notify_on_release tasks
 (plus whatever files added by the attached subsystems)
 
 Now attach your shell to this cgroup:


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

end of thread, other threads:[~2009-09-24  0:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-09-24  0:12 [PATCH] Update documentation of cgroups tasks and procs files Paul Menage
2009-09-24  0:12 Paul Menage
     [not found] ` <20090924001249.4783.91619.stgit-u3IScbYxn0zHt/MElyovVYaSKrA+ACpX0E9HWUfgJXw@public.gmane.org>
2009-09-24  0:43   ` Li Zefan
2009-09-24  0:43 ` Li Zefan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.