Re: [PATCH 1/7] cgroup: fix and update documentation

2008-02-19 Thread Paul Menage
On Feb 18, 2008 12:39 AM, Li Zefan <[EMAIL PROTECTED]> wrote:
> Misc fixes and updates, make the doc consistent with current
> cgroup implementation.
>
> Signed-off-by: Li Zefan <[EMAIL PROTECTED]>

Acked-by: Paul Menage <[EMAIL PROTECTED]>

Thanks for these cleanups.

Paul

> ---
>  Documentation/cgroups.txt |   66 ++--
>  1 files changed, 33 insertions(+), 33 deletions(-)
>
> diff --git a/Documentation/cgroups.txt b/Documentation/cgroups.txt
> index 42d7c4c..31d12e2 100644
>
> --- a/Documentation/cgroups.txt
> +++ b/Documentation/cgroups.txt
> @@ -28,7 +28,7 @@ CONTENTS:
>  4. Questions
>
>  1. Control Groups
> -==
> +=
>
>  1.1 What are cgroups ?
>  --
> @@ -143,10 +143,10 @@ proliferation of such cgroups.
>
>  Also lets say that the administrator would like to give enhanced network
>  access temporarily to a student's browser (since it is night and the user
> -wants to do online gaming :)  OR give one of the students simulation
> +wants to do online gaming :))  OR give one of the students simulation
>  apps enhanced CPU power,
>
> -With ability to write pids directly to resource classes, its just a
> +With ability to write pids directly to resource classes, it's just a
>  matter of :
>
> # echo pid > /mnt/network//tasks
> @@ -227,10 +227,13 @@ 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
> - - notify_on_release flag: run /sbin/cgroup_release_agent on exit?
> + - releasable flag: cgroup currently removeable?
> + - 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)
>
>  Other subsystems such as cpusets may add additional files in each
> -cgroup dir
> +cgroup dir.
>
>  New cgroups are created using the mkdir system call or shell
>  command.  The properties of a cgroup, such as its flags, are
> @@ -257,7 +260,7 @@ performance.
>  To allow access from a cgroup to the css_sets (and hence tasks)
>  that comprise it, a set of cg_cgroup_link objects form a lattice;
>  each cg_cgroup_link is linked into a list of cg_cgroup_links for
> -a single cgroup on its cont_link_list field, and a list of
> +a single cgroup on its cgrp_link_list field, and a list of
>  cg_cgroup_links for a single css_set on its cg_link_list.
>
>  Thus the set of tasks in a cgroup can be listed by iterating over
> @@ -271,9 +274,6 @@ for cgroups, with a minimum of additional kernel code.
>  1.4 What does notify_on_release do ?
>  
>
> -*** notify_on_release is disabled in the current patch set. It will be
> -*** reactivated in a future patch in a less-intrusive manner
> -
>  If the notify_on_release flag is enabled (1) in a cgroup, then
>  whenever the last task in the cgroup leaves (exits or attaches to
>  some other cgroup) and the last child cgroup of that cgroup
> @@ -360,8 +360,8 @@ Now you want to do something with this cgroup.
>
>  In this directory you can find several files:
>  # ls
> -notify_on_release release_agent tasks
> -(plus whatever files are added by the attached subsystems)
> +notify_on_release releasable tasks
> +(plus whatever files added by the attached subsystems)
>
>  Now attach your shell to this cgroup:
>  # /bin/echo $$ > tasks
> @@ -404,19 +404,13 @@ with a subsystem id which will be assigned by the 
> cgroup system.
>  Other fields in the cgroup_subsys object include:
>
>  - subsys_id: a unique array index for the subsystem, indicating which
> -  entry in cgroup->subsys[] this subsystem should be
> -  managing. Initialized by cgroup_register_subsys(); prior to this
> -  it should be initialized to -1
> +  entry in cgroup->subsys[] this subsystem should be managing.
>
> -- hierarchy: an index indicating which hierarchy, if any, this
> -  subsystem is currently attached to. If this is -1, then the
> -  subsystem is not attached to any hierarchy, and all tasks should be
> -  considered to be members of the subsystem's top_cgroup. It should
> -  be initialized to -1.
> +- name: should be initialized to a unique subsystem name. Should be
> +  no longer than MAX_CGROUP_TYPE_NAMELEN.
>
> -- name: should be initialized to a unique subsystem name prior to
> -  calling cgroup_register_subsystem. Should be no longer than
> -  MAX_CGROUP_TYPE_NAMELEN
> +- early_init: indicate if the subsystem needs early initialization
> +  at system boot.
>
>  Each cgroup object created by the system has an array of pointers,
>  indexed by subsystem id; this pointer is entirely managed by the
> @@ -434,8 +428,6 @@ situation.
>  See kernel/cgroup.c for more details.
>
>  Subsystems can take/release the cgroup_mutex via the functions
> -cgroup_lock()/cgroup_unlock(), and can
> -take/release the callback_mutex via the functions
>  

Re: [PATCH 1/7] cgroup: fix and update documentation

2008-02-19 Thread Paul Menage
On Feb 18, 2008 12:39 AM, Li Zefan [EMAIL PROTECTED] wrote:
 Misc fixes and updates, make the doc consistent with current
 cgroup implementation.

 Signed-off-by: Li Zefan [EMAIL PROTECTED]

Acked-by: Paul Menage [EMAIL PROTECTED]

Thanks for these cleanups.

Paul

 ---
  Documentation/cgroups.txt |   66 ++--
  1 files changed, 33 insertions(+), 33 deletions(-)

 diff --git a/Documentation/cgroups.txt b/Documentation/cgroups.txt
 index 42d7c4c..31d12e2 100644

 --- a/Documentation/cgroups.txt
 +++ b/Documentation/cgroups.txt
 @@ -28,7 +28,7 @@ CONTENTS:
  4. Questions

  1. Control Groups
 -==
 +=

  1.1 What are cgroups ?
  --
 @@ -143,10 +143,10 @@ proliferation of such cgroups.

  Also lets say that the administrator would like to give enhanced network
  access temporarily to a student's browser (since it is night and the user
 -wants to do online gaming :)  OR give one of the students simulation
 +wants to do online gaming :))  OR give one of the students simulation
  apps enhanced CPU power,

 -With ability to write pids directly to resource classes, its just a
 +With ability to write pids directly to resource classes, it's just a
  matter of :

 # echo pid  /mnt/network/new_class/tasks
 @@ -227,10 +227,13 @@ 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
 - - notify_on_release flag: run /sbin/cgroup_release_agent on exit?
 + - releasable flag: cgroup currently removeable?
 + - 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)

  Other subsystems such as cpusets may add additional files in each
 -cgroup dir
 +cgroup dir.

  New cgroups are created using the mkdir system call or shell
  command.  The properties of a cgroup, such as its flags, are
 @@ -257,7 +260,7 @@ performance.
  To allow access from a cgroup to the css_sets (and hence tasks)
  that comprise it, a set of cg_cgroup_link objects form a lattice;
  each cg_cgroup_link is linked into a list of cg_cgroup_links for
 -a single cgroup on its cont_link_list field, and a list of
 +a single cgroup on its cgrp_link_list field, and a list of
  cg_cgroup_links for a single css_set on its cg_link_list.

  Thus the set of tasks in a cgroup can be listed by iterating over
 @@ -271,9 +274,6 @@ for cgroups, with a minimum of additional kernel code.
  1.4 What does notify_on_release do ?
  

 -*** notify_on_release is disabled in the current patch set. It will be
 -*** reactivated in a future patch in a less-intrusive manner
 -
  If the notify_on_release flag is enabled (1) in a cgroup, then
  whenever the last task in the cgroup leaves (exits or attaches to
  some other cgroup) and the last child cgroup of that cgroup
 @@ -360,8 +360,8 @@ Now you want to do something with this cgroup.

  In this directory you can find several files:
  # ls
 -notify_on_release release_agent tasks
 -(plus whatever files are added by the attached subsystems)
 +notify_on_release releasable tasks
 +(plus whatever files added by the attached subsystems)

  Now attach your shell to this cgroup:
  # /bin/echo $$  tasks
 @@ -404,19 +404,13 @@ with a subsystem id which will be assigned by the 
 cgroup system.
  Other fields in the cgroup_subsys object include:

  - subsys_id: a unique array index for the subsystem, indicating which
 -  entry in cgroup-subsys[] this subsystem should be
 -  managing. Initialized by cgroup_register_subsys(); prior to this
 -  it should be initialized to -1
 +  entry in cgroup-subsys[] this subsystem should be managing.

 -- hierarchy: an index indicating which hierarchy, if any, this
 -  subsystem is currently attached to. If this is -1, then the
 -  subsystem is not attached to any hierarchy, and all tasks should be
 -  considered to be members of the subsystem's top_cgroup. It should
 -  be initialized to -1.
 +- name: should be initialized to a unique subsystem name. Should be
 +  no longer than MAX_CGROUP_TYPE_NAMELEN.

 -- name: should be initialized to a unique subsystem name prior to
 -  calling cgroup_register_subsystem. Should be no longer than
 -  MAX_CGROUP_TYPE_NAMELEN
 +- early_init: indicate if the subsystem needs early initialization
 +  at system boot.

  Each cgroup object created by the system has an array of pointers,
  indexed by subsystem id; this pointer is entirely managed by the
 @@ -434,8 +428,6 @@ situation.
  See kernel/cgroup.c for more details.

  Subsystems can take/release the cgroup_mutex via the functions
 -cgroup_lock()/cgroup_unlock(), and can
 -take/release the callback_mutex via the functions
  cgroup_lock()/cgroup_unlock().

  Accessing a task's cgroup pointer may be done in the following ways:
 @@ -444,7 +436,7 @@ Accessing a task's 

Re: [PATCH 1/7] cgroup: fix and update documentation

2008-02-18 Thread Li Zefan
Misc fixes and updates, make the doc consistent with current
cgroup implementation.

Signed-off-by: Li Zefan <[EMAIL PROTECTED]>
---
 Documentation/cgroups.txt |   66 ++--
 1 files changed, 33 insertions(+), 33 deletions(-)

diff --git a/Documentation/cgroups.txt b/Documentation/cgroups.txt
index 42d7c4c..31d12e2 100644
--- a/Documentation/cgroups.txt
+++ b/Documentation/cgroups.txt
@@ -28,7 +28,7 @@ CONTENTS:
 4. Questions
 
 1. Control Groups
-==
+=
 
 1.1 What are cgroups ?
 --
@@ -143,10 +143,10 @@ proliferation of such cgroups.
 
 Also lets say that the administrator would like to give enhanced network
 access temporarily to a student's browser (since it is night and the user
-wants to do online gaming :)  OR give one of the students simulation
+wants to do online gaming :))  OR give one of the students simulation
 apps enhanced CPU power,
 
-With ability to write pids directly to resource classes, its just a
+With ability to write pids directly to resource classes, it's just a
 matter of :
 
# echo pid > /mnt/network//tasks
@@ -227,10 +227,13 @@ 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
- - notify_on_release flag: run /sbin/cgroup_release_agent on exit?
+ - releasable flag: cgroup currently removeable?
+ - 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)
 
 Other subsystems such as cpusets may add additional files in each
-cgroup dir
+cgroup dir.
 
 New cgroups are created using the mkdir system call or shell
 command.  The properties of a cgroup, such as its flags, are
@@ -257,7 +260,7 @@ performance.
 To allow access from a cgroup to the css_sets (and hence tasks)
 that comprise it, a set of cg_cgroup_link objects form a lattice;
 each cg_cgroup_link is linked into a list of cg_cgroup_links for
-a single cgroup on its cont_link_list field, and a list of
+a single cgroup on its cgrp_link_list field, and a list of
 cg_cgroup_links for a single css_set on its cg_link_list.
 
 Thus the set of tasks in a cgroup can be listed by iterating over
@@ -271,9 +274,6 @@ for cgroups, with a minimum of additional kernel code.
 1.4 What does notify_on_release do ?
 
 
-*** notify_on_release is disabled in the current patch set. It will be
-*** reactivated in a future patch in a less-intrusive manner
-
 If the notify_on_release flag is enabled (1) in a cgroup, then
 whenever the last task in the cgroup leaves (exits or attaches to
 some other cgroup) and the last child cgroup of that cgroup
@@ -360,8 +360,8 @@ Now you want to do something with this cgroup.
 
 In this directory you can find several files:
 # ls
-notify_on_release release_agent tasks
-(plus whatever files are added by the attached subsystems)
+notify_on_release releasable tasks
+(plus whatever files added by the attached subsystems)
 
 Now attach your shell to this cgroup:
 # /bin/echo $$ > tasks
@@ -404,19 +404,13 @@ with a subsystem id which will be assigned by the cgroup 
system.
 Other fields in the cgroup_subsys object include:
 
 - subsys_id: a unique array index for the subsystem, indicating which
-  entry in cgroup->subsys[] this subsystem should be
-  managing. Initialized by cgroup_register_subsys(); prior to this
-  it should be initialized to -1
+  entry in cgroup->subsys[] this subsystem should be managing.
 
-- hierarchy: an index indicating which hierarchy, if any, this
-  subsystem is currently attached to. If this is -1, then the
-  subsystem is not attached to any hierarchy, and all tasks should be
-  considered to be members of the subsystem's top_cgroup. It should
-  be initialized to -1.
+- name: should be initialized to a unique subsystem name. Should be
+  no longer than MAX_CGROUP_TYPE_NAMELEN.
 
-- name: should be initialized to a unique subsystem name prior to
-  calling cgroup_register_subsystem. Should be no longer than
-  MAX_CGROUP_TYPE_NAMELEN
+- early_init: indicate if the subsystem needs early initialization
+  at system boot.
 
 Each cgroup object created by the system has an array of pointers,
 indexed by subsystem id; this pointer is entirely managed by the
@@ -434,8 +428,6 @@ situation.
 See kernel/cgroup.c for more details.
 
 Subsystems can take/release the cgroup_mutex via the functions
-cgroup_lock()/cgroup_unlock(), and can
-take/release the callback_mutex via the functions
 cgroup_lock()/cgroup_unlock().
 
 Accessing a task's cgroup pointer may be done in the following ways:
@@ -444,7 +436,7 @@ Accessing a task's cgroup pointer may be done in the 
following ways:
 - inside an rcu_read_lock() section via rcu_dereference()
 
 3.3 Subsystem API
---
+-
 
 Each subsystem should:
 
@@ -455,7 

Re: [PATCH 1/7] cgroup: fix and update documentation

2008-02-18 Thread Li Zefan
Paul Jackson wrote:
> Li Zefan wrote:
>>  *** notify_on_release is disabled in the current patch set. It will be
>> -*** reactivated in a future patch in a less-intrusive manner
>> +*** reactivated in a future patch in a less-intrusive manner.
> 
> Someone should verify this, but I'm pretty sure that notify_on_release
> is now working ... no longer disabled.  I believe the above line from
> the documentation is out of date.
> 

Aha, it does work now. I tried it but it didn't seem to work, maybe I didn't
something wrong. I'll resend a new patch.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 1/7] cgroup: fix and update documentation

2008-02-18 Thread Li Zefan
Paul Jackson wrote:
 Li Zefan wrote:
  *** notify_on_release is disabled in the current patch set. It will be
 -*** reactivated in a future patch in a less-intrusive manner
 +*** reactivated in a future patch in a less-intrusive manner.
 
 Someone should verify this, but I'm pretty sure that notify_on_release
 is now working ... no longer disabled.  I believe the above line from
 the documentation is out of date.
 

Aha, it does work now. I tried it but it didn't seem to work, maybe I didn't
something wrong. I'll resend a new patch.

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 1/7] cgroup: fix and update documentation

2008-02-18 Thread Li Zefan
Misc fixes and updates, make the doc consistent with current
cgroup implementation.

Signed-off-by: Li Zefan [EMAIL PROTECTED]
---
 Documentation/cgroups.txt |   66 ++--
 1 files changed, 33 insertions(+), 33 deletions(-)

diff --git a/Documentation/cgroups.txt b/Documentation/cgroups.txt
index 42d7c4c..31d12e2 100644
--- a/Documentation/cgroups.txt
+++ b/Documentation/cgroups.txt
@@ -28,7 +28,7 @@ CONTENTS:
 4. Questions
 
 1. Control Groups
-==
+=
 
 1.1 What are cgroups ?
 --
@@ -143,10 +143,10 @@ proliferation of such cgroups.
 
 Also lets say that the administrator would like to give enhanced network
 access temporarily to a student's browser (since it is night and the user
-wants to do online gaming :)  OR give one of the students simulation
+wants to do online gaming :))  OR give one of the students simulation
 apps enhanced CPU power,
 
-With ability to write pids directly to resource classes, its just a
+With ability to write pids directly to resource classes, it's just a
 matter of :
 
# echo pid  /mnt/network/new_class/tasks
@@ -227,10 +227,13 @@ 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
- - notify_on_release flag: run /sbin/cgroup_release_agent on exit?
+ - releasable flag: cgroup currently removeable?
+ - 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)
 
 Other subsystems such as cpusets may add additional files in each
-cgroup dir
+cgroup dir.
 
 New cgroups are created using the mkdir system call or shell
 command.  The properties of a cgroup, such as its flags, are
@@ -257,7 +260,7 @@ performance.
 To allow access from a cgroup to the css_sets (and hence tasks)
 that comprise it, a set of cg_cgroup_link objects form a lattice;
 each cg_cgroup_link is linked into a list of cg_cgroup_links for
-a single cgroup on its cont_link_list field, and a list of
+a single cgroup on its cgrp_link_list field, and a list of
 cg_cgroup_links for a single css_set on its cg_link_list.
 
 Thus the set of tasks in a cgroup can be listed by iterating over
@@ -271,9 +274,6 @@ for cgroups, with a minimum of additional kernel code.
 1.4 What does notify_on_release do ?
 
 
-*** notify_on_release is disabled in the current patch set. It will be
-*** reactivated in a future patch in a less-intrusive manner
-
 If the notify_on_release flag is enabled (1) in a cgroup, then
 whenever the last task in the cgroup leaves (exits or attaches to
 some other cgroup) and the last child cgroup of that cgroup
@@ -360,8 +360,8 @@ Now you want to do something with this cgroup.
 
 In this directory you can find several files:
 # ls
-notify_on_release release_agent tasks
-(plus whatever files are added by the attached subsystems)
+notify_on_release releasable tasks
+(plus whatever files added by the attached subsystems)
 
 Now attach your shell to this cgroup:
 # /bin/echo $$  tasks
@@ -404,19 +404,13 @@ with a subsystem id which will be assigned by the cgroup 
system.
 Other fields in the cgroup_subsys object include:
 
 - subsys_id: a unique array index for the subsystem, indicating which
-  entry in cgroup-subsys[] this subsystem should be
-  managing. Initialized by cgroup_register_subsys(); prior to this
-  it should be initialized to -1
+  entry in cgroup-subsys[] this subsystem should be managing.
 
-- hierarchy: an index indicating which hierarchy, if any, this
-  subsystem is currently attached to. If this is -1, then the
-  subsystem is not attached to any hierarchy, and all tasks should be
-  considered to be members of the subsystem's top_cgroup. It should
-  be initialized to -1.
+- name: should be initialized to a unique subsystem name. Should be
+  no longer than MAX_CGROUP_TYPE_NAMELEN.
 
-- name: should be initialized to a unique subsystem name prior to
-  calling cgroup_register_subsystem. Should be no longer than
-  MAX_CGROUP_TYPE_NAMELEN
+- early_init: indicate if the subsystem needs early initialization
+  at system boot.
 
 Each cgroup object created by the system has an array of pointers,
 indexed by subsystem id; this pointer is entirely managed by the
@@ -434,8 +428,6 @@ situation.
 See kernel/cgroup.c for more details.
 
 Subsystems can take/release the cgroup_mutex via the functions
-cgroup_lock()/cgroup_unlock(), and can
-take/release the callback_mutex via the functions
 cgroup_lock()/cgroup_unlock().
 
 Accessing a task's cgroup pointer may be done in the following ways:
@@ -444,7 +436,7 @@ Accessing a task's cgroup pointer may be done in the 
following ways:
 - inside an rcu_read_lock() section via rcu_dereference()
 
 3.3 Subsystem API
---
+-
 
 Each subsystem should:
 
@@ -455,7 

Re: [PATCH 1/7] cgroup: fix and update documentation

2008-02-17 Thread Paul Jackson
Li Zefan wrote:
>  *** notify_on_release is disabled in the current patch set. It will be
> -*** reactivated in a future patch in a less-intrusive manner
> +*** reactivated in a future patch in a less-intrusive manner.

Someone should verify this, but I'm pretty sure that notify_on_release
is now working ... no longer disabled.  I believe the above line from
the documentation is out of date.

-- 
  I won't rest till it's the best ...
  Programmer, Linux Scalability
  Paul Jackson <[EMAIL PROTECTED]> 1.940.382.4214
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 1/7] cgroup: fix and update documentation

2008-02-17 Thread Li Zefan
Misc fixes and updates, make the doc consistent with current
cgroup implementation.

Signed-off-by: Li Zefan <[EMAIL PROTECTED]>

---
 Documentation/cgroups.txt |   65 +++-
 1 files changed, 34 insertions(+), 31 deletions(-)

diff --git a/Documentation/cgroups.txt b/Documentation/cgroups.txt
index 42d7c4c..dfadd75 100644
--- a/Documentation/cgroups.txt
+++ b/Documentation/cgroups.txt
@@ -28,7 +28,7 @@ CONTENTS:
 4. Questions
 
 1. Control Groups
-==
+=
 
 1.1 What are cgroups ?
 --
@@ -143,10 +143,10 @@ proliferation of such cgroups.
 
 Also lets say that the administrator would like to give enhanced network
 access temporarily to a student's browser (since it is night and the user
-wants to do online gaming :)  OR give one of the students simulation
+wants to do online gaming :))  OR give one of the students simulation
 apps enhanced CPU power,
 
-With ability to write pids directly to resource classes, its just a
+With ability to write pids directly to resource classes, it's just a
 matter of :
 
# echo pid > /mnt/network//tasks
@@ -227,10 +227,13 @@ 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
- - notify_on_release flag: run /sbin/cgroup_release_agent on exit?
+ - releasable flag: cgroup currently removeable?
+ - 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)
 
 Other subsystems such as cpusets may add additional files in each
-cgroup dir
+cgroup dir.
 
 New cgroups are created using the mkdir system call or shell
 command.  The properties of a cgroup, such as its flags, are
@@ -257,7 +260,7 @@ performance.
 To allow access from a cgroup to the css_sets (and hence tasks)
 that comprise it, a set of cg_cgroup_link objects form a lattice;
 each cg_cgroup_link is linked into a list of cg_cgroup_links for
-a single cgroup on its cont_link_list field, and a list of
+a single cgroup on its cgrp_link_list field, and a list of
 cg_cgroup_links for a single css_set on its cg_link_list.
 
 Thus the set of tasks in a cgroup can be listed by iterating over
@@ -272,7 +275,7 @@ for cgroups, with a minimum of additional kernel code.
 
 
 *** notify_on_release is disabled in the current patch set. It will be
-*** reactivated in a future patch in a less-intrusive manner
+*** reactivated in a future patch in a less-intrusive manner.
 
 If the notify_on_release flag is enabled (1) in a cgroup, then
 whenever the last task in the cgroup leaves (exits or attaches to
@@ -360,8 +363,8 @@ Now you want to do something with this cgroup.
 
 In this directory you can find several files:
 # ls
-notify_on_release release_agent tasks
-(plus whatever files are added by the attached subsystems)
+notify_on_release releasable tasks
+(plus whatever files added by the attached subsystems)
 
 Now attach your shell to this cgroup:
 # /bin/echo $$ > tasks
@@ -404,19 +407,13 @@ with a subsystem id which will be assigned by the cgroup 
system.
 Other fields in the cgroup_subsys object include:
 
 - subsys_id: a unique array index for the subsystem, indicating which
-  entry in cgroup->subsys[] this subsystem should be
-  managing. Initialized by cgroup_register_subsys(); prior to this
-  it should be initialized to -1
+  entry in cgroup->subsys[] this subsystem should be managing.
 
-- hierarchy: an index indicating which hierarchy, if any, this
-  subsystem is currently attached to. If this is -1, then the
-  subsystem is not attached to any hierarchy, and all tasks should be
-  considered to be members of the subsystem's top_cgroup. It should
-  be initialized to -1.
+- name: should be initialized to a unique subsystem name. Should be
+  no longer than MAX_CGROUP_TYPE_NAMELEN.
 
-- name: should be initialized to a unique subsystem name prior to
-  calling cgroup_register_subsystem. Should be no longer than
-  MAX_CGROUP_TYPE_NAMELEN
+- early_init: indicate if the subsystem needs early initialization
+  at system boot.
 
 Each cgroup object created by the system has an array of pointers,
 indexed by subsystem id; this pointer is entirely managed by the
@@ -434,8 +431,6 @@ situation.
 See kernel/cgroup.c for more details.
 
 Subsystems can take/release the cgroup_mutex via the functions
-cgroup_lock()/cgroup_unlock(), and can
-take/release the callback_mutex via the functions
 cgroup_lock()/cgroup_unlock().
 
 Accessing a task's cgroup pointer may be done in the following ways:
@@ -444,7 +439,7 @@ Accessing a task's cgroup pointer may be done in the 
following ways:
 - inside an rcu_read_lock() section via rcu_dereference()
 
 3.3 Subsystem API
---
+-
 
 Each subsystem should:
 
@@ -455,7 +450,8 @@ Each subsystem may export the 

[PATCH 1/7] cgroup: fix and update documentation

2008-02-17 Thread Li Zefan
Misc fixes and updates, make the doc consistent with current
cgroup implementation.

Signed-off-by: Li Zefan [EMAIL PROTECTED]

---
 Documentation/cgroups.txt |   65 +++-
 1 files changed, 34 insertions(+), 31 deletions(-)

diff --git a/Documentation/cgroups.txt b/Documentation/cgroups.txt
index 42d7c4c..dfadd75 100644
--- a/Documentation/cgroups.txt
+++ b/Documentation/cgroups.txt
@@ -28,7 +28,7 @@ CONTENTS:
 4. Questions
 
 1. Control Groups
-==
+=
 
 1.1 What are cgroups ?
 --
@@ -143,10 +143,10 @@ proliferation of such cgroups.
 
 Also lets say that the administrator would like to give enhanced network
 access temporarily to a student's browser (since it is night and the user
-wants to do online gaming :)  OR give one of the students simulation
+wants to do online gaming :))  OR give one of the students simulation
 apps enhanced CPU power,
 
-With ability to write pids directly to resource classes, its just a
+With ability to write pids directly to resource classes, it's just a
 matter of :
 
# echo pid  /mnt/network/new_class/tasks
@@ -227,10 +227,13 @@ 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
- - notify_on_release flag: run /sbin/cgroup_release_agent on exit?
+ - releasable flag: cgroup currently removeable?
+ - 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)
 
 Other subsystems such as cpusets may add additional files in each
-cgroup dir
+cgroup dir.
 
 New cgroups are created using the mkdir system call or shell
 command.  The properties of a cgroup, such as its flags, are
@@ -257,7 +260,7 @@ performance.
 To allow access from a cgroup to the css_sets (and hence tasks)
 that comprise it, a set of cg_cgroup_link objects form a lattice;
 each cg_cgroup_link is linked into a list of cg_cgroup_links for
-a single cgroup on its cont_link_list field, and a list of
+a single cgroup on its cgrp_link_list field, and a list of
 cg_cgroup_links for a single css_set on its cg_link_list.
 
 Thus the set of tasks in a cgroup can be listed by iterating over
@@ -272,7 +275,7 @@ for cgroups, with a minimum of additional kernel code.
 
 
 *** notify_on_release is disabled in the current patch set. It will be
-*** reactivated in a future patch in a less-intrusive manner
+*** reactivated in a future patch in a less-intrusive manner.
 
 If the notify_on_release flag is enabled (1) in a cgroup, then
 whenever the last task in the cgroup leaves (exits or attaches to
@@ -360,8 +363,8 @@ Now you want to do something with this cgroup.
 
 In this directory you can find several files:
 # ls
-notify_on_release release_agent tasks
-(plus whatever files are added by the attached subsystems)
+notify_on_release releasable tasks
+(plus whatever files added by the attached subsystems)
 
 Now attach your shell to this cgroup:
 # /bin/echo $$  tasks
@@ -404,19 +407,13 @@ with a subsystem id which will be assigned by the cgroup 
system.
 Other fields in the cgroup_subsys object include:
 
 - subsys_id: a unique array index for the subsystem, indicating which
-  entry in cgroup-subsys[] this subsystem should be
-  managing. Initialized by cgroup_register_subsys(); prior to this
-  it should be initialized to -1
+  entry in cgroup-subsys[] this subsystem should be managing.
 
-- hierarchy: an index indicating which hierarchy, if any, this
-  subsystem is currently attached to. If this is -1, then the
-  subsystem is not attached to any hierarchy, and all tasks should be
-  considered to be members of the subsystem's top_cgroup. It should
-  be initialized to -1.
+- name: should be initialized to a unique subsystem name. Should be
+  no longer than MAX_CGROUP_TYPE_NAMELEN.
 
-- name: should be initialized to a unique subsystem name prior to
-  calling cgroup_register_subsystem. Should be no longer than
-  MAX_CGROUP_TYPE_NAMELEN
+- early_init: indicate if the subsystem needs early initialization
+  at system boot.
 
 Each cgroup object created by the system has an array of pointers,
 indexed by subsystem id; this pointer is entirely managed by the
@@ -434,8 +431,6 @@ situation.
 See kernel/cgroup.c for more details.
 
 Subsystems can take/release the cgroup_mutex via the functions
-cgroup_lock()/cgroup_unlock(), and can
-take/release the callback_mutex via the functions
 cgroup_lock()/cgroup_unlock().
 
 Accessing a task's cgroup pointer may be done in the following ways:
@@ -444,7 +439,7 @@ Accessing a task's cgroup pointer may be done in the 
following ways:
 - inside an rcu_read_lock() section via rcu_dereference()
 
 3.3 Subsystem API
---
+-
 
 Each subsystem should:
 
@@ -455,7 +450,8 @@ Each subsystem may export 

Re: [PATCH 1/7] cgroup: fix and update documentation

2008-02-17 Thread Paul Jackson
Li Zefan wrote:
  *** notify_on_release is disabled in the current patch set. It will be
 -*** reactivated in a future patch in a less-intrusive manner
 +*** reactivated in a future patch in a less-intrusive manner.

Someone should verify this, but I'm pretty sure that notify_on_release
is now working ... no longer disabled.  I believe the above line from
the documentation is out of date.

-- 
  I won't rest till it's the best ...
  Programmer, Linux Scalability
  Paul Jackson [EMAIL PROTECTED] 1.940.382.4214
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/