<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://purl.org/rss/1.0/" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:syn="http://purl.org/rss/1.0/modules/syndication/" xmlns:admin="http://webns.net/mvcb/">
  <channel rdf:about="http://blog.gmane.org/gmane.linux.kernel.containers">
    <title>gmane.linux.kernel.containers</title>
    <link>http://blog.gmane.org/gmane.linux.kernel.containers</link>
    <description/>
    <syn:updatePeriod>hourly</syn:updatePeriod>
    <syn:updateFrequency>1</syn:updateFrequency>
    <syn:updateBase>1901-01-01T00:00+00:00</syn:updateBase>
    <items>
      <rdf:Seq>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.linux.kernel.containers/8320"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.linux.kernel.containers/8313"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.linux.kernel.containers/8312"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.linux.kernel.containers/8311"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.linux.kernel.containers/8308"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.linux.kernel.containers/8307"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.linux.kernel.containers/8288"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.linux.kernel.containers/8112"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.linux.kernel.containers/8102"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.linux.kernel.containers/8097"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.linux.kernel.containers/8096"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.linux.kernel.containers/8093"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.linux.kernel.containers/8074"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.linux.kernel.containers/8073"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.linux.kernel.containers/8072"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.linux.kernel.containers/8071"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.linux.kernel.containers/8070"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.linux.kernel.containers/8069"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.linux.kernel.containers/8064"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.linux.kernel.containers/8063"/>
      </rdf:Seq>
    </items>
    <image rdf:resource="http://gmane.org/img/gmane-25t.png"/>
    <textinput rdf:resource=""/>
  </channel>
  <image rdf:about="http://gmane.org/img/gmane-25t.png">
    <title>Gmane</title>
    <url>http://gmane.org/img/gmane-25t.png</url>
    <link>http://gmane.org</link>
  </image>
  <item rdf:about="http://comments.gmane.org/gmane.linux.kernel.containers/8320">
    <title>[PATCH] Unused check for thread group leader in mem_cgroup_move_task</title>
    <link>http://comments.gmane.org/gmane.linux.kernel.containers/8320</link>
    <description>Currently we just check for thread group leader in attach() handler but do 
nothing!  Either (1) move it to can_attach handler or (2) remove the test 
itself. I am attaching patches for both below.

Thanks
Nikanth Karthikesan

Move thread group leader check to can_attach handler, but this may prevent non 
thread group leaders to be moved at all! 

Signed-off-by: Nikanth Karthikesan &lt;knikanth-l3A5Bk7waGM&lt; at &gt;public.gmane.org&gt;

---
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index 866dcc7..26bc823 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
&lt; at &gt;&lt; at &gt; -1136,6 +1136,18 &lt; at &gt;&lt; at &gt; static int mem_cgroup_populate(struct cgroup_subsys 
*ss,
 ARRAY_SIZE(mem_cgroup_files));
 }
 
+static int mem_cgroup_can_attach(struct cgroup_subsys *ss,
+                          struct cgroup *cgrp, struct task_struct *tsk)
+{
+/*
+ * Only thread group leaders are allowed to migrate, the mm_struct is
+ * in effect owned by the leader
+ */
+if (!thread_group_leader(tsk))
+return -EINVAL;
+return 0;
+}
+
 static void mem_cgroup_mo</description>
    <dc:creator>Nikanth Karthikesan</dc:creator>
    <dc:date>2008-11-29T07:29:27</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.linux.kernel.containers/8313">
    <title>[PATCH 3/3] cgroups: introduce link_css_set() to remove duplicate code</title>
    <link>http://comments.gmane.org/gmane.linux.kernel.containers/8313</link>
    <description>Add a common function link_css_set() to link a css_set to a cgroup.

Signed-off-by: Li Zefan &lt;lizf-BthXqXjhjHXQFUHtdCDX3A&lt; at &gt;public.gmane.org&gt;
---
 kernel/cgroup.c |   62 +++++++++++++++++++++---------------------------------
 1 files changed, 24 insertions(+), 38 deletions(-)

diff --git a/kernel/cgroup.c b/kernel/cgroup.c
index 4e50e97..1442077 100644
--- a/kernel/cgroup.c
+++ b/kernel/cgroup.c
&lt; at &gt;&lt; at &gt; -385,6 +385,19 &lt; at &gt;&lt; at &gt; static int allocate_cg_links(int count, struct list_head *tmp)
 return 0;
 }
 
+static void link_css_set(struct list_head *tmp_cg_links,
+ struct css_set *cg, struct cgroup *cgrp)
+{
+struct cg_cgroup_link *link;
+
+BUG_ON(list_empty(tmp_cg_links));
+link = list_first_entry(tmp_cg_links, struct cg_cgroup_link,
+cgrp_link_list);
+link-&gt;cg = cg;
+list_move(&amp;link-&gt;cgrp_link_list, &amp;cgrp-&gt;css_sets);
+list_add(&amp;link-&gt;cg_link_list, &amp;cg-&gt;cg_links);
+}
+
 /*
  * find_css_set() takes an existing cgroup group and a
  * cgroup object, and returns a css_set object that's
&lt; at &gt;&lt; at &gt; -400,7 +413,6 &lt; at &gt;&lt; at &gt; static</description>
    <dc:creator>Li Zefan</dc:creator>
    <dc:date>2008-11-28T10:02:42</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.linux.kernel.containers/8312">
    <title>[PATCH 2/3] cgroups: add inactive subsystems to rootnode.root_list</title>
    <link>http://comments.gmane.org/gmane.linux.kernel.containers/8312</link>
    <description>Though for an inactive hierarchy, we have subsys-&gt;root == &amp;rootnode,
but rootnode's root_list is always empty.

This conflicts with the code in find_css_set():

for (i = 0; i &lt; CGROUP_SUBSYS_COUNT; i++) {
...
if (ss-&gt;root-&gt;subsys_list.next == &amp;ss-&gt;sibling) {
...
}
}
if (list_empty(&amp;rootnode.subsys_list)) {
...
}

The above code assumes rootnode.subsys_list links all inactive
hierarchies.

Signed-off-by: Li Zefan &lt;lizf-BthXqXjhjHXQFUHtdCDX3A&lt; at &gt;public.gmane.org&gt;
---
 kernel/cgroup.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/kernel/cgroup.c b/kernel/cgroup.c
index 33ba756..4e50e97 100644
--- a/kernel/cgroup.c
+++ b/kernel/cgroup.c
&lt; at &gt;&lt; at &gt; -716,7 +716,7 &lt; at &gt;&lt; at &gt; static int rebind_subsystems(struct cgroupfs_root *root,
 BUG_ON(dummytop-&gt;subsys[i]-&gt;cgroup != dummytop);
 cgrp-&gt;subsys[i] = dummytop-&gt;subsys[i];
 cgrp-&gt;subsys[i]-&gt;cgroup = cgrp;
-list_add(&amp;ss-&gt;sibling, &amp;root-&gt;subsys_list);
+list_move(&amp;ss-&gt;sibling, &amp;root-&gt;subsys_list);
 rcu_assign_pointer(ss-&gt;root, </description>
    <dc:creator>Li Zefan</dc:creator>
    <dc:date>2008-11-28T10:02:37</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.linux.kernel.containers/8311">
    <title>[PATCH 1/3] cgroups: make root_list contains active hierarchies only</title>
    <link>http://comments.gmane.org/gmane.linux.kernel.containers/8311</link>
    <description>Don't link rootnode to the root list, so root_list contains active
hierarchies only as the comment indicates. And rename for_each_root()
to for_each_active_root().

Also remove redundant check in cgroup_kill_sb().

Signed-off-by: Li Zefan &lt;lizf-BthXqXjhjHXQFUHtdCDX3A&lt; at &gt;public.gmane.org&gt;
---
 kernel/cgroup.c |   19 +++++++------------
 1 files changed, 7 insertions(+), 12 deletions(-)

diff --git a/kernel/cgroup.c b/kernel/cgroup.c
index fe00b3b..33ba756 100644
--- a/kernel/cgroup.c
+++ b/kernel/cgroup.c
&lt; at &gt;&lt; at &gt; -84,7 +84,7 &lt; at &gt;&lt; at &gt; struct cgroupfs_root {
 /* Tracks how many cgroups are currently defined in hierarchy.*/
 int number_of_cgroups;
 
-/* A list running through the mounted hierarchies */
+/* A list running through the active hierarchies */
 struct list_head root_list;
 
 /* Hierarchy-specific flags */
&lt; at &gt;&lt; at &gt; -149,8 +149,8 &lt; at &gt;&lt; at &gt; static int notify_on_release(const struct cgroup *cgrp)
 #define for_each_subsys(_root, _ss) \
 list_for_each_entry(_ss, &amp;_root-&gt;subsys_list, sibling)
 
-/* for_each_root() allows you to </description>
    <dc:creator>Li Zefan</dc:creator>
    <dc:date>2008-11-28T10:02:33</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.linux.kernel.containers/8308">
    <title>[PATCH] cgroups: add link_css_set() to remove duplicate code</title>
    <link>http://comments.gmane.org/gmane.linux.kernel.containers/8308</link>
    <description>Add a common function link_css_set() to link a css_set to a
cgroup.

Signed-off-by: Li Zefan &lt;lizf-BthXqXjhjHXQFUHtdCDX3A&lt; at &gt;public.gmane.org&gt;
---
 kernel/cgroup.c |   51 ++++++++++++++++++++++-----------------------------
 1 files changed, 22 insertions(+), 29 deletions(-)

diff --git a/kernel/cgroup.c b/kernel/cgroup.c
index 46d9981..42d0597 100644
--- a/kernel/cgroup.c
+++ b/kernel/cgroup.c
&lt; at &gt;&lt; at &gt; -384,6 +384,19 &lt; at &gt;&lt; at &gt; static int allocate_cg_links(int count, struct list_head *tmp)
 return 0;
 }
 
+static void link_css_set(struct list_head *tmp_cg_links,
+ struct css_set *cg, struct cgroup *cgrp)
+{
+struct cg_cgroup_link *link;
+
+BUG_ON(list_empty(tmp_cg_links));
+link = list_first_entry(tmp_cg_links, struct cg_cgroup_link,
+cgrp_link_list);
+link-&gt;cg = cg;
+list_move(&amp;link-&gt;cgrp_link_list, &amp;cgrp-&gt;css_sets);
+list_add(&amp;link-&gt;cg_link_list, &amp;cg-&gt;cg_links);
+}
+
 /*
  * find_css_set() takes an existing cgroup group and a
  * cgroup object, and returns a css_set object that's
&lt; at &gt;&lt; at &gt; -399,7 +412,6 &lt; at &gt;&lt; at &gt; static st</description>
    <dc:creator>Li Zefan</dc:creator>
    <dc:date>2008-11-28T07:27:12</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.linux.kernel.containers/8307">
    <title>[PATCH 1/2] cgroups: cleanup for dummy root</title>
    <link>http://comments.gmane.org/gmane.linux.kernel.containers/8307</link>
    <description>- Don't link rootnode to the root list, so root_list contains active
  hierarchies only as the comment indicates.

- Don't link css_sets to the dummy cgroup, because we never want to
  run through the tasks in that dummpy cgroup (which means run
  through all the tasks in the system).

Signed-off-by: Li Zefan &lt;lizf-BthXqXjhjHXQFUHtdCDX3A&lt; at &gt;public.gmane.org&gt;
---
 kernel/cgroup.c |   24 ++----------------------
 1 files changed, 2 insertions(+), 22 deletions(-)

diff --git a/kernel/cgroup.c b/kernel/cgroup.c
index fe00b3b..46d9981 100644
--- a/kernel/cgroup.c
+++ b/kernel/cgroup.c
&lt; at &gt;&lt; at &gt; -84,7 +84,7 &lt; at &gt;&lt; at &gt; struct cgroupfs_root {
 /* Tracks how many cgroups are currently defined in hierarchy.*/
 int number_of_cgroups;
 
-/* A list running through the mounted hierarchies */
+/* A list running through the active hierarchies */
 struct list_head root_list;
 
 /* Hierarchy-specific flags */
&lt; at &gt;&lt; at &gt; -184,7 +184,6 &lt; at &gt;&lt; at &gt; struct cg_cgroup_link {
  */
 
 static struct css_set init_css_set;
-static struct cg_cgroup_link init_css_set</description>
    <dc:creator>Li Zefan</dc:creator>
    <dc:date>2008-11-28T07:27:08</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.linux.kernel.containers/8288">
    <title>[RFC v10][PATCH 00/13] Kernel based checkpoint/restart</title>
    <link>http://comments.gmane.org/gmane.linux.kernel.containers/8288</link>
    <description>Checkpoint-restart (c/r): fixes a couple of bugs and a DoS issue
(tested against v2.6.28-rc3).

We'd like these to make it into -mm. This version addresses the
last of the known bugs. Please pull at least the first 11 patches,
as they are similar to before.

Patches 1-11 are stable, providing self- and external- c/r of a
single process.
Patches 12 and 13 are newer, adding support for c/r of multiple
processes.

The git tree tracking v10, branch 'ckpt-v10' (and older versions):
git://git.ncl.cs.columbia.edu/pub/git/linux-cr.git

Restarting multiple processes requires 'mktree' userspace tool:
git://git.ncl.cs.columbia.edu/pub/git/user-cr.git

Oren.


--
Why do we want it?  It allows containers to be moved between physical
machines' kernels in the same way that VMWare can move VMs between
physical machines' hypervisors.  There are currently at least two
out-of-tree implementations of this in the commercial world (IBM's
Metacluster and Parallels' OpenVZ/Virtuozzo) and several in the academic
world like Zap.

W</description>
    <dc:creator>Oren Laadan</dc:creator>
    <dc:date>2008-11-27T01:04:31</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.linux.kernel.containers/8112">
    <title>[PATCH 01/53] xfrm: initialise xfrm_policy_gc_work statically</title>
    <link>http://comments.gmane.org/gmane.linux.kernel.containers/8112</link>
    <description>Signed-off-by: Alexey Dobriyan &lt;adobriyan-Re5JQEeQqe8AvxtiuMwx3w&lt; at &gt;public.gmane.org&gt;
---
 net/xfrm/xfrm_policy.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c
index 1785488..ea3456d 100644
--- a/net/xfrm/xfrm_policy.c
+++ b/net/xfrm/xfrm_policy.c
&lt; at &gt;&lt; at &gt; -55,7 +55,6 &lt; at &gt;&lt; at &gt; static struct xfrm_policy_afinfo *xfrm_policy_afinfo[NPROTO];
 
 static struct kmem_cache *xfrm_dst_cache __read_mostly;
 
-static struct work_struct xfrm_policy_gc_work;
 static HLIST_HEAD(xfrm_policy_gc_list);
 static DEFINE_SPINLOCK(xfrm_policy_gc_lock);
 
&lt; at &gt;&lt; at &gt; -296,6 +295,7 &lt; at &gt;&lt; at &gt; static void xfrm_policy_gc_task(struct work_struct *work)
 hlist_for_each_entry_safe(policy, entry, tmp, &amp;gc_list, bydst)
 xfrm_policy_gc_kill(policy);
 }
+static DECLARE_WORK(xfrm_policy_gc_work, xfrm_policy_gc_task);
 
 /* Rule must be locked. Release descentant resources, announce
  * entry dead. The rule must be unlinked from lists to the moment.
&lt; at &gt;&lt; at &gt; -2425,7 +2425,6 &lt; at &gt;&lt; at &gt; static void __init xfrm_p</description>
    <dc:creator>Alexey Dobriyan</dc:creator>
    <dc:date>2008-11-25T17:26:33</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.linux.kernel.containers/8102">
    <title>[PATCH 0/2] In-kernel process restart</title>
    <link>http://comments.gmane.org/gmane.linux.kernel.containers/8102</link>
    <description>These patchset introduces OpenVZ kernel based restart procedure on top of
Oren's checkpoint/restart patchset v9.

For restarting a set of processes one will need to call sys_restart() once with
new flag CR_CTX_RSTR_IN_KERNEL. All work will be done in kernel in this case.

Small changes to image format are required to make in-kernel process creation
more easy.

Oren, please take a look on this patchset. I've tried to port OpenVZ
functionality on top of yours with minimal changes.
</description>
    <dc:creator>Andrey Mirkin</dc:creator>
    <dc:date>2008-11-24T15:39:33</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.linux.kernel.containers/8097">
    <title>Livres anciens, restauration et conservation</title>
    <link>http://comments.gmane.org/gmane.linux.kernel.containers/8097</link>
    <description>
_______________________________________________
Containers mailing list
Containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA&lt; at &gt;public.gmane.org
https://lists.linux-foundation.org/mailman/listinfo/containers</description>
    <dc:creator>Jean-Louis Yaich</dc:creator>
    <dc:date>2008-11-24T08:52:47</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.linux.kernel.containers/8096">
    <title>Livres anciens, restauration et conservation</title>
    <link>http://comments.gmane.org/gmane.linux.kernel.containers/8096</link>
    <description>
_______________________________________________
Containers mailing list
Containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA&lt; at &gt;public.gmane.org
https://lists.linux-foundation.org/mailman/listinfo/containers</description>
    <dc:creator>Jean-Louis Yaich</dc:creator>
    <dc:date>2008-11-24T08:52:47</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.linux.kernel.containers/8093">
    <title>Get your Blackberry Bold/$300 or Apple iPhone 16GB/$25</title>
    <link>http://comments.gmane.org/gmane.linux.kernel.containers/8093</link>
    <description>


Apple iPhone 16GB.......$250 per unit
Blackberry Bold.............$300 per unit

Video Games
Playstation 3 ........$220
Nintendo Wii......... $200
Sony PSP......... ....$140
Xbox 360 Platinum/Premium.... $140

Apple ipod Nano 4gb....$100
Apple ipod Nano 80gb...$250

GSM PHONES

Motorola V3i D&amp;G......$250
Nokia N95......... ...$320
Nokia N93......... ...$260
Nokia N93i ...........$280
Nokia N70 ............$160
Nokia N72 ............$175
Nokia N73 ............$250
Nokia N80 ............$200
Nokia N90 ............$200
Nokia N91 ............$200

BUY ANY 5 UNITS AND GET 2 FREE


All GSM Phones,Brand New,Tri- Band and Video Games are also Brand new with
Complete Accessories plus Int'l Warranty .


e-mail us for more enquiry

gadgets.lmtd05-Re5JQEeQqe8AvxtiuMwx3w&lt; at &gt;public.gmane.org

GADGETS LIMITED (UK) LTD
Registered No. 05881519
THE OLD STABLES, ARUNDEL ROAD,
POLING, ARUNDEL, WEST SUSSEX, BN18 9QA
UNITED KINGDOM
</description>
    <dc:creator>Gadgets Lmtd UK</dc:creator>
    <dc:date>2008-11-22T11:00:42</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.linux.kernel.containers/8074">
    <title>[PATCH] memcontrol: rcu_read_lock() to protect mm_match_cgroup()</title>
    <link>http://comments.gmane.org/gmane.linux.kernel.containers/8074</link>
    <description>
mm_match_cgroup() calls cgroup_subsys_state().

we must use rcu_read_lock() to protect cgroup_subsys_state().

Signed-off-by: Lai Jiangshan &lt;laijs-BthXqXjhjHXQFUHtdCDX3A&lt; at &gt;public.gmane.org&gt;
---
diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h
index 1fbe14d..ce89ff0 100644
--- a/include/linux/memcontrol.h
+++ b/include/linux/memcontrol.h
&lt; at &gt;&lt; at &gt; -47,8 +47,15 &lt; at &gt;&lt; at &gt; int task_in_mem_cgroup(struct task_struct *task, const struct mem_cgroup *mem);
 
 extern struct mem_cgroup *mem_cgroup_from_task(struct task_struct *p);
 
-#define mm_match_cgroup(mm, cgroup)\
-((cgroup) == mem_cgroup_from_task((mm)-&gt;owner))
+static inline
+int mm_match_cgroup(const struct mm_struct *mm, const struct mem_cgroup *cgroup)
+{
+struct mem_cgroup *mem;
+rcu_read_lock();
+mem = mem_cgroup_from_task((mm)-&gt;owner);
+rcu_read_unlock();
+return cgroup == mem;
+}
 
 extern int
 mem_cgroup_prepare_migration(struct page *page, struct page *newpage);
</description>
    <dc:creator>Lai Jiangshan</dc:creator>
    <dc:date>2008-11-21T08:49:43</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.linux.kernel.containers/8073">
    <title>[PATCH] cgroups: defer free css_set</title>
    <link>http://comments.gmane.org/gmane.linux.kernel.containers/8073</link>
    <description>
we free css_set when refcnt became 0 immediately(except cgroup_attach_task()).
I will destroy the data which read side maybe still access it.
this patch use call_rcu() to defer free css_set

Signed-off-by: Lai Jiangshan &lt;laijs-BthXqXjhjHXQFUHtdCDX3A&lt; at &gt;public.gmane.org&gt;
---
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h
index 1164963..22901ff 100644
--- a/include/linux/cgroup.h
+++ b/include/linux/cgroup.h
&lt; at &gt;&lt; at &gt; -178,6 +178,8 &lt; at &gt;&lt; at &gt; struct css_set {
  */
 struct list_head cg_links;
 
+struct rcu_head rcu;
+
 /*
  * Set of subsystem states, one for each subsystem. This array
  * is immutable after creation apart from the init_css_set
diff --git a/kernel/cgroup.c b/kernel/cgroup.c
index 358e775..ddc10ac 100644
--- a/kernel/cgroup.c
+++ b/kernel/cgroup.c
&lt; at &gt;&lt; at &gt; -252,6 +252,11 &lt; at &gt;&lt; at &gt; static void unlink_css_set(struct css_set *cg)
 }
 }
 
+static void rcu_free_css_set(struct rcu_head *head)
+{
+kfree(container_of(head, struct css_set, rcu));
+}
+
 static void __put_css_set(struct css_set *cg, int taskexit)
 </description>
    <dc:creator>Lai Jiangshan</dc:creator>
    <dc:date>2008-11-21T08:49:31</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.linux.kernel.containers/8072">
    <title>[PATCH 1/2] cgroups: enhance task_cgroup()</title>
    <link>http://comments.gmane.org/gmane.linux.kernel.containers/8072</link>
    <description>
task_cgroup() calls cgroup_subsys_state().
and we must use rcu_read_lock() to protect cgroup_subsys_state().
so we must use rcu_read_lock() to protect task_cgroup().

but it'll not so friendly to caller: the callers of task_cgroup() have
held cgroup_lock(). it means that struct cgroup will not be freed.

So this patch add rcu_read_lock() in task_cgroup() to enhance task_cgroup().
And we do NOT NEED FIX task_cgroup()'s callers, and cgroup_lock()
can protect task_cgroup().

Signed-off-by: Lai Jiangshan &lt;laijs-BthXqXjhjHXQFUHtdCDX3A&lt; at &gt;public.gmane.org&gt;
---
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h
index 1164963..22901ff 100644
--- a/include/linux/cgroup.h
+++ b/include/linux/cgroup.h
&lt; at &gt;&lt; at &gt; -359,6 +360,10 &lt; at &gt;&lt; at &gt;
 static inline struct cgroup* task_cgroup(struct task_struct *task,
        int subsys_id)
 {
-return task_subsys_state(task, subsys_id)-&gt;cgroup;
+struct cgroup *ret;
+rcu_read_lock();
+ret = task_subsys_state(task, subsys_id)-&gt;cgroup;
+rcu_read_unlock();
+return ret;
 }
 
 int cgro</description>
    <dc:creator>Lai Jiangshan</dc:creator>
    <dc:date>2008-11-21T08:49:46</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.linux.kernel.containers/8071">
    <title>[PATCH] cpuset: rcu_read_lock() to protect task_cs() even we don'tdereference to task_cs()'s return value</title>
    <link>http://comments.gmane.org/gmane.linux.kernel.containers/8071</link>
    <description>
task_cs() calls cgroup_subsys_state().

we must use rcu_read_lock() to protect cgroup_subsys_state().

in current_cpuset_is_being_rebound(), we don't dereference to task_cs()'s
return value, but task_cs() accesses css_set, this css_set maybe freed
when task_cs() called.

Signed-off-by: Lai Jiangshan &lt;laijs-BthXqXjhjHXQFUHtdCDX3A&lt; at &gt;public.gmane.org&gt;
---
diff --git a/kernel/cpuset.c b/kernel/cpuset.c
index 3e00526..e0e087e 100644
--- a/kernel/cpuset.c
+++ b/kernel/cpuset.c
&lt; at &gt;&lt; at &gt; -1141,7 +1136,11 &lt; at &gt;&lt; at &gt; done:
 
 int current_cpuset_is_being_rebound(void)
 {
-return task_cs(current) == cpuset_being_rebound;
+struct cpuset *cs;
+rcu_read_lock();
+cs = task_cs(current);
+rcu_read_unlock();
+return cs == cpuset_being_rebound;
 }
 
 static int update_relax_domain_level(struct cpuset *cs, s64 val)
</description>
    <dc:creator>Lai Jiangshan</dc:creator>
    <dc:date>2008-11-21T08:49:40</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.linux.kernel.containers/8070">
    <title>[PATCH] cpuset: rcu_read_lock() to protect task_cs()</title>
    <link>http://comments.gmane.org/gmane.linux.kernel.containers/8070</link>
    <description>
task_cs() calls cgroup_subsys_state().

we must use rcu_read_lock() to protect cgroup_subsys_state().

it's correct that top_cpuset is never freed, but cgroup_subsys_state()
accesses css_set, this css_set maybe freed when task_cs() called.

we use use rcu_read_lock() to protect it.

Signed-off-by: Lai Jiangshan &lt;laijs-BthXqXjhjHXQFUHtdCDX3A&lt; at &gt;public.gmane.org&gt;
---
diff --git a/kernel/cpuset.c b/kernel/cpuset.c
index 3e00526..e0e087e 100644
--- a/kernel/cpuset.c
+++ b/kernel/cpuset.c
&lt; at &gt;&lt; at &gt; -363,14 +363,9 &lt; at &gt;&lt; at &gt; void cpuset_update_task_memory_state(void)
 struct task_struct *tsk = current;
 struct cpuset *cs;
 
-if (task_cs(tsk) == &amp;top_cpuset) {
-/* Don't need rcu for top_cpuset.  It's never freed. */
-my_cpusets_mem_gen = top_cpuset.mems_generation;
-} else {
-rcu_read_lock();
-my_cpusets_mem_gen = task_cs(tsk)-&gt;mems_generation;
-rcu_read_unlock();
-}
+rcu_read_lock();
+my_cpusets_mem_gen = task_cs(tsk)-&gt;mems_generation;
+rcu_read_unlock();
 
 if (my_cpusets_mem_gen != tsk-&gt;cpuset_mems_generation)</description>
    <dc:creator>Lai Jiangshan</dc:creator>
    <dc:date>2008-11-21T08:49:37</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.linux.kernel.containers/8069">
    <title>[PATCH] cgroups: use task_lock() for access tsk-&gt;cgroups safe incgroup_clone()</title>
    <link>http://comments.gmane.org/gmane.linux.kernel.containers/8069</link>
    <description>
use task_lock() protect tsk-&gt;cgroups and get_css_set(tsk-&gt;cgroups)


Signed-off-by: Lai Jiangshan &lt;laijs-BthXqXjhjHXQFUHtdCDX3A&lt; at &gt;public.gmane.org&gt;
---
diff --git a/kernel/cgroup.c b/kernel/cgroup.c
index 358e775..ddc10ac 100644
--- a/kernel/cgroup.c
+++ b/kernel/cgroup.c
&lt; at &gt;&lt; at &gt; -2933,6 +2943,7 &lt; at &gt;&lt; at &gt; int cgroup_clone(struct task_struct *tsk, struct cgroup_subsys *subsys,
 mutex_unlock(&amp;cgroup_mutex);
 return 0;
 }
+task_lock(tsk);
 cg = tsk-&gt;cgroups;
 parent = task_cgroup(tsk, subsys-&gt;subsys_id);
 
&lt; at &gt;&lt; at &gt; -2941,6 +2952,7 &lt; at &gt;&lt; at &gt; int cgroup_clone(struct task_struct *tsk, struct cgroup_subsys *subsys,
 
 /* Keep the cgroup alive */
 get_css_set(cg);
+task_unlock(tsk);
 mutex_unlock(&amp;cgroup_mutex);
 
 /* Now do the VFS work to create a cgroup */
</description>
    <dc:creator>Lai Jiangshan</dc:creator>
    <dc:date>2008-11-21T08:49:55</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.linux.kernel.containers/8064">
    <title>[PATCH] cgroups: call find_css_set() safely in cgroup_attach_task()</title>
    <link>http://comments.gmane.org/gmane.linux.kernel.containers/8064</link>
    <description>
in cgroup_attach_task(), tsk maybe exit when we call find_css_set().
and find_css_set() will access to invalid css_set.

this patch increase the count before get_css_set(), and decrease it
after find_css_set().

NOTICE:
css_set's refcount is also taskcount, after this patch applied, taskcount
may be off-by-one WHEN cgroup_lock() is not held.
but I reviewed other code which use taskcount, they are still correct.
No regression found by reviewing and simply testing.

So I do not use two counters in css_set.
(one counter for taskcount, the other for refcount. like struct mm_struct)
If this fix cause regression, we will use two counters in css_set.

Signed-off-by: Lai Jiangshan &lt;laijs-BthXqXjhjHXQFUHtdCDX3A&lt; at &gt;public.gmane.org&gt;
---
diff --git a/kernel/cgroup.c b/kernel/cgroup.c
index 358e775..ddc10ac 100644
--- a/kernel/cgroup.c
+++ b/kernel/cgroup.c
&lt; at &gt;&lt; at &gt; -1217,7 +1222,7 &lt; at &gt;&lt; at &gt; int cgroup_attach_task(struct cgroup *cgrp, struct task_struct *tsk)
 int retval = 0;
 struct cgroup_subsys *ss;
 struct cgroup *oldcgrp;
-st</description>
    <dc:creator>Lai Jiangshan</dc:creator>
    <dc:date>2008-11-21T08:49:59</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.linux.kernel.containers/8063">
    <title>[PATCH 2/2] cpuset: use cgroup_path() in proc_cpuset_show()</title>
    <link>http://comments.gmane.org/gmane.linux.kernel.containers/8063</link>
    <description>
use cgroup_path() instead of
task_subsys_state(tsk, cpuset_subsys_id)-&gt;cgroup

Signed-off-by: Lai Jiangshan &lt;laijs-BthXqXjhjHXQFUHtdCDX3A&lt; at &gt;public.gmane.org&gt;
---
diff --git a/kernel/cpuset.c b/kernel/cpuset.c
index 3e00526..e0e087e 100644
--- a/kernel/cpuset.c
+++ b/kernel/cpuset.c
&lt; at &gt;&lt; at &gt; -2387,7 +2386,7 &lt; at &gt;&lt; at &gt; static int proc_cpuset_show(struct seq_file *m, void *unused_v)
 struct pid *pid;
 struct task_struct *tsk;
 char *buf;
-struct cgroup_subsys_state *css;
+struct cgroup *cgp;
 int retval;
 
 retval = -ENOMEM;
&lt; at &gt;&lt; at &gt; -2403,8 +2402,8 &lt; at &gt;&lt; at &gt; static int proc_cpuset_show(struct seq_file *m, void *unused_v)
 
 retval = -EINVAL;
 cgroup_lock();
-css = task_subsys_state(tsk, cpuset_subsys_id);
-retval = cgroup_path(css-&gt;cgroup, buf, PAGE_SIZE);
+cgp = task_cgroup(tsk, cpuset_subsys_id);
+retval = cgroup_path(cgp, buf, PAGE_SIZE);
 if (retval &lt; 0)
 goto out_unlock;
 seq_puts(m, buf);
</description>
    <dc:creator>Lai Jiangshan</dc:creator>
    <dc:date>2008-11-21T08:49:50</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.linux.kernel.containers/8062">
    <title>[PATCH] cgroups: fix incorrect using rcu_dereference() incgroup_subsys_state()</title>
    <link>http://comments.gmane.org/gmane.linux.kernel.containers/8062</link>
    <description>
It's task-&gt;cgroups protected by RCU. and struct css_set.subsys[subsys_id]
is readonly(after init). so we don't need rcu_dereference() for
struct css_set.subsys[subsys_id].

the ways using cgroup_subsys_state() safely:

#1:
rcu_read_lock() / task_lock();
c = cgroup_subsys_state(tsk, id);
use c;
rcu_read_unlock() / task_unlock();


#2: use cgroup_lock() for _current_ task.
cgroup_lock();
c = cgroup_subsys_state(current, id);
use c;
cgroup_unlock();

Signed-off-by: Lai Jiangshan &lt;laijs-BthXqXjhjHXQFUHtdCDX3A&lt; at &gt;public.gmane.org&gt;
---
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h
index 1164963..22901ff 100644
--- a/include/linux/cgroup.h
+++ b/include/linux/cgroup.h
&lt; at &gt;&lt; at &gt; -359,10 +360,15 &lt; at &gt;&lt; at &gt; static inline struct cgroup_subsys_state *cgroup_subsys_state(
 return cgrp-&gt;subsys[subsys_id];
 }
 
+/* Caller must hold task_lock() or rcu_read_lock() */
 static inline struct cgroup_subsys_state *task_subsys_state(
 struct task_struct *task, int subsys_id)
 {
-return rcu_dereference(task-&gt;cgroups-&gt;subsys[subsys</description>
    <dc:creator>Lai Jiangshan</dc:creator>
    <dc:date>2008-11-21T08:49:34</dc:date>
  </item>
  <textinput rdf:about="http://search.gmane.org/?group=$group=gmane.linux.kernel.containers">
    <title>Search Engine</title>
    <description>Search the mailing list at Gmane</description>
    <name>query</name>
    <link>http://search.gmane.org/?group=$group=gmane.linux.kernel.containers</link>
  </textinput>
</rdf:RDF>
