Inter-revision diff: patch 2

Comparing v2 (message) to v3 (message)

--- v2
+++ v3
@@ -19,23 +19,35 @@
 Cc: Paul Menage <paul-inf54ven1CmVyaH7bEyXVA@public.gmane.org>
 Cc: Mandeep Singh Baines <msb-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
 ---
- kernel/cgroup.c |   10 +++++++---
- 1 files changed, 7 insertions(+), 3 deletions(-)
+ kernel/cgroup.c |   23 +++++++++++++++++------
+ 1 files changed, 17 insertions(+), 6 deletions(-)
 
 diff --git a/kernel/cgroup.c b/kernel/cgroup.c
-index 24f6d6f..1999f60 100644
+index 24f6d6f..4936d88 100644
 --- a/kernel/cgroup.c
 +++ b/kernel/cgroup.c
-@@ -4556,7 +4556,7 @@ static const struct file_operations proc_cgroupstats_operations = {
+@@ -4556,20 +4556,31 @@ static const struct file_operations proc_cgroupstats_operations = {
   *
   * A pointer to the shared css_set was automatically copied in
   * fork.c by dup_task_struct().  However, we ignore that copy, since
 - * it was not made under the protection of RCU or cgroup_mutex, so
-+ * it was not made under the protection of threadgroup_change_begin(), so
-  * might no longer be a valid cgroup pointer.  cgroup_attach_task() might
-  * have already changed current->cgroups, allowing the previously
-  * referenced cgroup group to be removed and freed.
-@@ -4566,10 +4566,14 @@ static const struct file_operations proc_cgroupstats_operations = {
+- * might no longer be a valid cgroup pointer.  cgroup_attach_task() might
+- * have already changed current->cgroups, allowing the previously
+- * referenced cgroup group to be removed and freed.
++ * it was not made under the protection of RCU, cgroup_mutex or
++ * threadgroup_change_begin(), so it might no longer be a valid
++ * cgroup pointer.  cgroup_attach_task() might have already changed
++ * current->cgroups, allowing the previously referenced cgroup
++ * group to be removed and freed.
++ *
++ * Outside the pointer validity we also need to process the css_set
++ * inheritance between threadgoup_change_begin() and
++ * threadgoup_change_end(), this way there is no leak in any process
++ * wide migration performed by cgroup_attach_proc() that could otherwise
++ * miss a thread because it is too early or too late in the fork stage.
+  *
+  * At the point that cgroup_fork() is called, 'current' is the parent
+  * task, and the passed argument 'child' points to the child task.
   */
  void cgroup_fork(struct task_struct *child)
  {
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help