Linux Headquarters
[ Register ]
[ About us ] [ Home Page ]

Advertisement
[ Kernel ] [ Documentation ] [ Links ] [ Books ]

Advertisement

Kernel v2.6.25.2 /kernel/cgroup.c

Filename:/kernel/cgroup.c
Lines Added:6
Lines Deleted:1
Also changed in: (Previous) 2.6.25-git20  2.6.25-git19  2.6.25.1  2.6.25-git18  2.6.25-git17  2.6.25-git16 
(Following) 2.6.25.3  2.6.25.4  2.6.25.5  2.6.25.6-rc1  2.6.25.6-rc2  2.6.25.6 

Location
[  2.6.25.2
  [  kernel
     o  cgroup.c

Patch

diff --git a/kernel/cgroup.c b/kernel/cgroup.c
index 2727f92..6d8de05 100644
--- a/kernel/cgroup.c
+++ b/kernel/cgroup.c
@@ -1722,7 +1722,12 @@ void cgroup_enable_task_cg_lists(void)
    use_task_css_set_links = 1;
    do_each_thread(g, p) {
       task_lock(p);
-      if (list_empty(&p->cg_list))
+      /*
+       * We should check if the process is exiting, otherwise
+       * it will race with cgroup_exit() in that the list
+       * entry won't be deleted though the process has exited.
+       */
+      if (!(p->flags & PF_EXITING) && list_empty(&p->cg_list))
          list_add(&p->cg_list, &p->cgroups->tasks);
       task_unlock(p);
    } while_each_thread(g, p);


Comments: webmaster (at) linuxhq.com.
Advertising: banners (at) linuxhq.com.
Compilation ©1998-2008 Linux Headquarters, Inc.