Re: [Devel] [PATCH] cgroup: fix fail path in cgroup_load_subsys()

2013-12-11 Thread Li Zefan
err_unload; - Moving online_css() upwards should be fine. Acked-by: Li Zefan lize...@huawei.com /* success! */ mutex_unlock(cgroup_mutex); return 0; -err_unload: +free_css: + list_del(ss-sibling); + ss-css_free(css); +out_err: + /* failure case - need

Re: [Devel] [PATCH cgroup/for-3.13-fixes] cgroup: fix oops in cgroup init failure path

2013-12-09 Thread Li Zefan
On 2013/12/6 5:18, Tejun Heo wrote: Hello, Vladimir. Thanks a lot for the report and fix; however, I really wanna make sure that only online css's become visible, so I wrote up a different fix. Can you please test this one? Oh, I spotted this bug when reviewing a bug fix months ago.

[Devel] Re: [PATCH v5 2/2] decrement static keys on real destroy time

2012-05-13 Thread Li Zefan
+static void disarm_static_keys(struct mem_cgroup *memcg) +{ +#ifdef CONFIG_INET + if (memcg-tcp_mem.cg_proto.activated) + static_key_slow_dec(memcg_socket_limit_enabled); +#endif +} Move this inside the ifdef/endif below ? Otherwise I think you'll get compile error if

[Devel] Re: [PATCH v2 4/5] don't take cgroup_mutex in destroy()

2012-04-25 Thread Li Zefan
Glauber Costa wrote: On 04/23/2012 11:31 PM, KAMEZAWA Hiroyuki wrote: (2012/04/24 4:37), Glauber Costa wrote: Most of the destroy functions are only doing very simple things like freeing memory. The ones who goes through lists and such, already use its own locking for those. * The

[Devel] Re: [PATCH 2/3] don't take cgroup_mutex in destroy()

2012-04-21 Thread Li Zefan
Glauber Costa wrote: On 04/19/2012 07:57 PM, Tejun Heo wrote: On Thu, Apr 19, 2012 at 07:49:17PM -0300, Glauber Costa wrote: Most of the destroy functions are only doing very simple things like freeing memory. The ones who goes through lists and such, already use its own locking for those.

[Devel] Re: bind() call in cgroup's css structure

2012-04-20 Thread Li Zefan
Glauber Costa wrote: Hello Tejun, During your cgroup refactor, I was wondering if you have any plans to get rid of the bind() callback that is called when hierarchies are moved? I planned to remove it long ago, and Paul M agreed. But after some time, I was trying to make use of it in a

[Devel] Re: [PATCH 2/3] don't take cgroup_mutex in destroy()

2012-04-20 Thread Li Zefan
Tejun Heo wrote: On Thu, Apr 19, 2012 at 07:49:17PM -0300, Glauber Costa wrote: Most of the destroy functions are only doing very simple things like freeing memory. The ones who goes through lists and such, already use its own locking for those. * The cgroup itself won't go away until we

[Devel] Re: [RFC] cgroup basic comounting

2011-12-19 Thread Li Zefan
. Signed-off-by: Glauber Costa glom...@parallels.com CC: Paul Turner p...@google.com CC: Li Zefan l...@cn.fujitsu.com --- kernel/cgroup.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/cgroup.c b/kernel/cgroup.c index 1fd7867..e894a4f 100644 --- a/kernel

[Devel] Re: [PATCH 3/3] make 'none' field a flag

2011-12-13 Thread Li Zefan
于 2011年12月13日 23:41, Tejun Heo 写道: On Sun, Dec 11, 2011 at 03:45:38PM +0100, Glauber Costa wrote: There is no reason to have a flags field, and then a separate bool field just to indicate if 'none' subsystem were explicitly requested. Make it a flag Signed-off-by: Glauber Costa

[Devel] Re: [PATCH 1/3] nitpick: make simple functions inline

2011-12-13 Thread Li Zefan
22:45, Glauber Costa wrote: Those are quite simple bit-testing functions that are only used within this file. Not reason for them not to be inline. It's better to leave the optimization decision to gcc. And I've confirmed they are inlined by gcc in my box. (btw, please add cgroup prefix to

[Devel] Re: [PATCH 1/3] cgroup - removing superfluous rcu_read_lock_held check

2011-02-24 Thread Li Zefan
, jirka and this should be excluded from the changelog. Signed-off-by: Jiri Olsa jo...@redhat.com Reviewed-by: Li Zefan l...@cn.fujitsu.com However a nitpick: --- include/linux/cgroup.h |1 - kernel/cgroup.c|6 ++ 2 files changed, 2 insertions(+), 5 deletions

[Devel] Re: [PATCH v2] cgroup: prefer [kv]zalloc[_node] over [kv]malloc+memset in memory controller code.

2011-02-24 Thread Li Zefan
In mem_cgroup_alloc() we currently do either kmalloc() or vmalloc() then followed by memset() to zero the memory. This can be more efficiently achieved by using kzalloc() and vzalloc(). There's also one situation where we can use kzalloc_node() - this is what's new in this version of the

[Devel] Re: [PATCH 1/1, v6] cgroup/freezer: add per freezer duty ratio control

2011-02-09 Thread Li Zefan
jacob pan wrote: On Wed, 09 Feb 2011 11:07:59 +0800 Li Zefan l...@cn.fujitsu.com wrote: jacob.jun@linux.intel.com wrote: From: Jacob Pan jacob.jun@linux.intel.com Freezer subsystem is used to manage batch jobs which can start stop at the same time. However, sometime

[Devel] Re: [PATCH 1/1, v6] cgroup/freezer: add per freezer duty ratio control

2011-02-08 Thread Li Zefan
jacob.jun@linux.intel.com wrote: From: Jacob Pan jacob.jun@linux.intel.com Freezer subsystem is used to manage batch jobs which can start stop at the same time. However, sometime it is desirable to let the kernel manage the freezer state automatically with a given duty ratio. For

[Devel] Re: [PATCH] cgroup : remove the ns_cgroup

2011-01-26 Thread Li Zefan
Andrew Morton wrote: On Tue, 25 Jan 2011 10:39:48 +0100 Daniel Lezcano daniel.lezc...@free.fr wrote: This patch removes the ns_cgroup as suggested in the following thread: I had this patch queued up in September last year, but dropped it. Why did I do that? Because you wanted to wait

[Devel] Re: linux-next: lockdep whinge in cgroup_rmdir

2011-01-13 Thread Li Zefan
lock order annotation, but mainline cgroupfs code looks to be OK there. What does cgroup_clear_directory() look like in mmotm? It's not from cgroup_clear_directory().. This should fix it: = From: Li Zefan l...@cn.fujitsu.com Date: Fri, 14 Jan 2011 11:34:34 +0800 Subject

[Devel] kernel BUG at fs/dcache.c:1363 (from cgroup)

2011-01-13 Thread Li Zefan
Just mount the cgroupfs: # mount -t cgroup -o cpuset xxx /mnt (oops!!) The bug is caused by: = commit 0df6a63f8735a7c8a877878bc215d4312e41ef81 Author: Al Viro v...@zeniv.linux.org.uk Date: Tue Dec 21 13:29:29 2010 -0500 switch cgroup switching it to s_d_op allows to kill

[Devel] Re: kernel BUG at fs/dcache.c:1363 (from cgroup)

2011-01-13 Thread Li Zefan
Al Viro wrote: On Fri, Jan 14, 2011 at 12:56:17PM +0800, Li Zefan wrote: Just mount the cgroupfs: # mount -t cgroup -o cpuset xxx /mnt (oops!!) The bug is caused by: = commit 0df6a63f8735a7c8a877878bc215d4312e41ef81 Author: Al Viro v...@zeniv.linux.org.uk Date: Tue Dec 21 13

[Devel] Re: [PATCH v5 3/3] cgroups: make procs file writable

2010-12-29 Thread Li Zefan
David Rientjes wrote: On Wed, 29 Dec 2010, Li Zefan wrote: I think it would be appropriate to use a shared nodemask with file scope whenever you have cgroup_lock() to avoid the unnecessary kmalloc() even with GFP_KERNEL. Cpusets are traditionally used on very large machines in the first

[Devel] Re: [PATCH v5 3/3] cgroups: make procs file writable

2010-12-29 Thread Li Zefan
David Rientjes wrote: On Thu, 30 Dec 2010, Li Zefan wrote: That's what we did for cpu masks :). See commit 2341d1b6598c7146d64a5050b53a72a5a819617f. I made a patchset to remove on stack cpu masks. What I meant is we don't have to allocate nodemasks in cpuset_sprintf_memlist

[Devel] Re: [PATCH v5 3/3] cgroups: make procs file writable

2010-12-28 Thread Li Zefan
David Rientjes wrote: On Mon, 27 Dec 2010, Ben Blum wrote: I'm not sure what the benefit of defining it as a macro would be. You're defining these statically allocated nodemasks so they have file scope, I hope (so they can be shared amongst the users who synchronize on cgroup_lock()

[Devel] [PATCH v2 0/6] cgroups: Bindable cgroup subsystems

2010-12-15 Thread Li Zefan
Stephane posted a patchset to add perf_cgroup subsystem, so perf can be used to monitor all threads belonging to a cgroup. But if you already mounted a cgroup hierarchy but without perf_cgroup and the hierarchy has sub-cgroups, you can't bind perf_cgroup to it, and thus you're not able to use

[Devel] [PATCH v2 1/6] cgroups: Shrink struct cgroup_subsys

2010-12-15 Thread Li Zefan
On x86_32, sizeof(struct cgroup_subsys) shrinks from 276 bytes to 264. Acked-by: Paul Menage men...@google.com Signed-off-by: Li Zefan l...@cn.fujitsu.com --- include/linux/cgroup.h | 10 ++ 1 files changed, 6 insertions(+), 4 deletions(-) diff --git a/include/linux/cgroup.h b/include

[Devel] [PATCH v2 3/6] cgroups: Allow to unbind subsystem from a cgroup hierarchy

2010-12-15 Thread Li Zefan
. Signed-off-by: Li Zefan l...@cn.fujitsu.com --- include/linux/cgroup.h | 17 ++ kernel/cgroup.c| 139 +-- 2 files changed, 138 insertions(+), 18 deletions(-) diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h index d8c4e22..17579b2

[Devel] [PATCH v2 5/6] cgroups: Triger BUG if a bindable subsystem calls css_get()

2010-12-15 Thread Li Zefan
For now unbindable subsystems should not use css_get/put(), so check this misuse. Signed-off-by: Li Zefan l...@cn.fujitsu.com --- include/linux/cgroup.h |7 +-- kernel/cgroup.c|5 + 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/include/linux/cgroup.h b

[Devel] [PATCH v2 4/6] cgroups: Mark some subsystems bindable/unbindable

2010-12-15 Thread Li Zefan
For those subsystems (debug, cpuacct, net_cls and devices), setting the bindable/unbindable flag is sufficient. Set freezer subsystem as bindable but not unbindable, because sub-cgroups' can be in FROZEN state. Signed-off-by: Li Zefan l...@cn.fujitsu.com --- kernel/cgroup.c |6

[Devel] [PATCH v2 6/6] cgroups: Update documentation for bindable subsystems

2010-12-15 Thread Li Zefan
Provide a usage example, update the bind() callback API, etc. Signed-off-by: Li Zefan l...@cn.fujitsu.com --- Documentation/cgroups/cgroups.txt | 37 + 1 files changed, 29 insertions(+), 8 deletions(-) diff --git a/Documentation/cgroups/cgroups.txt b

[Devel] Re: cgroup tasks file error

2010-12-13 Thread Li Zefan
ccmail111 wrote: Hi Serge, Now I cannot move the pid out of the assigned group ! Try: $ sudo echo 580 tasks [host:/dev/cgroup]$ cat cpuset.cpus 0 [host:/dev/cgroup]$ cat cpuset.mems 0 [host:/dev/cgroup]$ cat hello/tasks 580 [host:/dev/cgroup]$ echo 580 tasks -bash: echo:

[Devel] Re: [PATCH] cgroup: Convert synchronize_rcu to call_rcu in cgroup_attach_task

2010-11-23 Thread Li Zefan
12:06, Colin Cross wrote: The synchronize_rcu call in cgroup_attach_task can be very expensive. All fastpath accesses to task-cgroups that expect task-cgroups not to change already use task_lock() or cgroup_lock() to protect against updates, and, in cgroup.c, only the CGROUP_DEBUG files have

[Devel] Re: [PATCH] cgroup: Convert synchronize_rcu to call_rcu in cgroup_attach_task

2010-11-23 Thread Li Zefan
Paul Menage wrote: On Sun, Nov 21, 2010 at 8:06 PM, Colin Cross ccr...@android.com wrote: The synchronize_rcu call in cgroup_attach_task can be very expensive. All fastpath accesses to task-cgroups that expect task-cgroups not to change already use task_lock() or cgroup_lock() to protect

[Devel] Re: Mounting blkio cgroup hierarchy

2010-11-14 Thread Li Zefan
Ben Gamari wrote: I've been trying to configure cgroups and have encountered some very strange behavior. In particular, when I follow the instructions in Documentation/cgroups/blkio-controller.txt I quickly reach an error, $ cd /mnt $ sudo mkdir -p cgroups/blkio $ # Confirm it's not

[Devel] Re: [PATCH 1/7] cgroups: Shrink struct cgroup_subsys

2010-11-09 Thread Li Zefan
Paul Menage wrote: On Sun, Nov 7, 2010 at 9:23 PM, Li Zefan l...@cn.fujitsu.com wrote: bool active; bool disabled; ... ? With alignment 5-8 bool values == 8 bytes in 64-bit machine, compared to 4 bytes with the approach this patch takes. I meant specifying it as: bool active:1

[Devel] Re: [PATCH 1/7] cgroups: Shrink struct cgroup_subsys

2010-11-09 Thread Li Zefan
Paul Menage wrote: On Tue, Nov 9, 2010 at 4:52 PM, Li Zefan l...@cn.fujitsu.com wrote: bool active:1; bool disabled:1; It won't compile, but unsigned char active:1 will do. ;) Are you sure? I don't have a buildable kernel tree at the moment, but the following fragment compiled fine for me

[Devel] Re: [PATCH 1/7] cgroups: Shrink struct cgroup_subsys

2010-11-07 Thread Li Zefan
(Sorry for the delayed reply) Paul Menage wrote: On Fri, Oct 22, 2010 at 1:09 AM, Li Zefan l...@cn.fujitsu.com wrote: On x86_32, sizeof(struct cgroup_subsys) shrinks from 276 bytes to 264. Signed-off-by: Li Zefan l...@cn.fujitsu.com Acked-by: Paul Menage men...@google.com Maybe use

[Devel] Re: [PATCH 2/7] cgroups: Allow to bind a subsystem to a cgroup hierarchy

2010-11-07 Thread Li Zefan
Paul Menage wrote: On Fri, Oct 22, 2010 at 1:09 AM, Li Zefan l...@cn.fujitsu.com wrote: + /* +* Indicate if this subsystem can be bound/unbound to/from a cgroup +* hierarchy which has child cgroups. +*/ + unsigned int can_bind:1; Maybe call

[Devel] Re: [PATCH 7/7] cgroups: Update documentation for bindable subsystems

2010-11-07 Thread Li Zefan
Paul Menage wrote: Called when a cgroup subsystem is rebound to a different hierarchy -and root cgroup. Currently this will only involve movement between -the default hierarchy (which never has sub-cgroups) and a hierarchy -that is being created/destroyed (and hence has no sub-cgroups). +and

[Devel] Re: [PATCH 7/7] cgroups: Update documentation for bindable subsystems

2010-10-24 Thread Li Zefan
KAMEZAWA Hiroyuki wrote: On Fri, 22 Oct 2010 16:12:25 +0800 Li Zefan l...@cn.fujitsu.com wrote: Provide a usage example, and update the bind() callback API. Signed-off-by: Li Zefan l...@cn.fujitsu.com --- Documentation/cgroups/cgroups.txt | 26 +- 1 files

[Devel] Re: [PATCH 7/7] cgroups: Update documentation for bindable subsystems

2010-10-24 Thread Li Zefan
Li Zefan wrote: KAMEZAWA Hiroyuki wrote: On Fri, 22 Oct 2010 16:12:25 +0800 Li Zefan l...@cn.fujitsu.com wrote: Provide a usage example, and update the bind() callback API. Signed-off-by: Li Zefan l...@cn.fujitsu.com --- Documentation/cgroups/cgroups.txt | 26

[Devel] Re: [PATCH 2/7] cgroups: Allow to bind a subsystem to a cgroup hierarchy

2010-10-24 Thread Li Zefan
Peter Zijlstra wrote: On Fri, 2010-10-22 at 16:09 +0800, Li Zefan wrote: For example, we can't decide a cgroup's cpuset.mems and cpuset.cpus automatically, so cpuset is not bindable. You mean to say that you cannot add cpuset to an existing hierarchy right? Not that you cannot add perf

[Devel] Re: [PATCH 0/7] cgroups: Allow to bind/unbind subsystems to/from non-trival hierarchy

2010-10-24 Thread Li Zefan
Peter Zijlstra wrote: On Fri, 2010-10-22 at 16:09 +0800, Li Zefan wrote: Stephane posted a patchset to add perf_cgroup subsystem, so perf can be used to monitor all threads belonging to a cgroup. But if you already mounted a cgroup hierarchy but without perf_cgroup and the hierarchy has sub

[Devel] Re: [PATCH 2/7] cgroups: Allow to bind a subsystem to a cgroup hierarchy

2010-10-24 Thread Li Zefan
+/* + * cgroup_walk_herarchy - iterate through a cgroup hierarchy + * @process_cgroup: callback called on each cgroup in the hierarchy + * @data: will be passed to @process_cgroup + * @top_cgrp: the root cgroup of the hierarchy + * + * For such a hierarchy: + *a1c1 + *

[Devel] [PATCH 1/7] cgroups: Shrink struct cgroup_subsys

2010-10-22 Thread Li Zefan
On x86_32, sizeof(struct cgroup_subsys) shrinks from 276 bytes to 264. Signed-off-by: Li Zefan l...@cn.fujitsu.com --- include/linux/cgroup.h | 10 ++ 1 files changed, 6 insertions(+), 4 deletions(-) diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h index ed4ba11..e23ded6

[Devel] [PATCH 0/7] cgroups: Allow to bind/unbind subsystems to/from non-trival hierarchy

2010-10-22 Thread Li Zefan
Stephane posted a patchset to add perf_cgroup subsystem, so perf can be used to monitor all threads belonging to a cgroup. But if you already mounted a cgroup hierarchy but without perf_cgroup and the hierarchy has sub-cgroups, you can't bind perf_cgroup to it, and thus you're not able to use

[Devel] [PATCH 3/7] cgroups: Allow to unbind subsystem from a cgroup hierarachy

2010-10-22 Thread Li Zefan
(remove it from the hierarchy) # mount -o remount,cpuset xxx /mnt Signed-off-by: Li Zefan l...@cn.fujitsu.com --- kernel/cgroup.c | 76 --- 1 files changed, 61 insertions(+), 15 deletions(-) diff --git a/kernel/cgroup.c b/kernel/cgroup.c index

[Devel] [PATCH 2/7] cgroups: Allow to bind a subsystem to a cgroup hierarchy

2010-10-22 Thread Li Zefan
, and we add cpuacct to the hierarchy) # mount -o remount,cpuset,cpuacct xxx /mnt Signed-off-by: Li Zefan l...@cn.fujitsu.com --- include/linux/cgroup.h |5 + kernel/cgroup.c| 225 ++- 2 files changed, 187 insertions(+), 43 deletions(-) diff

[Devel] [PATCH 4/7] cgroups: Mark some subsystems bindable

2010-10-22 Thread Li Zefan
For those subsystems (debug, cpuacct, net_cls and devices), setting the can_bind flag is sufficient. Signed-off-by: Li Zefan l...@cn.fujitsu.com --- kernel/cgroup.c |1 + kernel/sched.c |1 + net/sched/cls_cgroup.c |1 + security/device_cgroup.c |1 + 4 files

[Devel] [PATCH 5/7] cgroups: Make freezer subsystem bindable

2010-10-22 Thread Li Zefan
To make it bindable, we need to thaw all processes when unbinding the freezer subsystem from a cgroup hierarchy. Signed-off-by: Li Zefan l...@cn.fujitsu.com --- include/linux/cgroup.h |3 ++- kernel/cgroup.c | 22 -- kernel/cgroup_freezer.c | 19

[Devel] [PATCH 6/7] cgroups: Warn if a bindable subsystem calls css_get()

2010-10-22 Thread Li Zefan
For now bindable subsystems should not use css_get/put(), so warn on this misuse. Signed-off-by: Li Zefan l...@cn.fujitsu.com --- include/linux/cgroup.h |7 +-- kernel/cgroup.c|3 +++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/include/linux/cgroup.h b

[Devel] [PATCH 7/7] cgroups: Update documentation for bindable subsystems

2010-10-22 Thread Li Zefan
Provide a usage example, and update the bind() callback API. Signed-off-by: Li Zefan l...@cn.fujitsu.com --- Documentation/cgroups/cgroups.txt | 26 +- 1 files changed, 17 insertions(+), 9 deletions(-) diff --git a/Documentation/cgroups/cgroups.txt b/Documentation

[Devel] Re: cgroup debug seems dead?

2010-10-19 Thread Li Zefan
Stephen Hemminger wrote: While running namespace checks to look for dead code, I found that debug_subsys is declared global but never used in current code. This leads to the fact that since debug_subsys is never used, the whole set of debugging functions is also never used. Is the whole

[Devel] Re: cgroup debug seems dead?

2010-10-19 Thread Li Zefan
Stephen Hemminger wrote: On Tue, 19 Oct 2010 18:14:10 -0700 Paul Menage men...@google.com wrote: On Tue, Oct 19, 2010 at 6:12 PM, Stephen Hemminger shemmin...@vyatta.com wrote: Where is it stored in an array? ~/kernel/linux-2.6$ git grep debug_subsys kernel/cgroup.c:

[Devel] Re: cgroup debug seems dead?

2010-10-19 Thread Li Zefan
Stephen Hemminger wrote: On Wed, 20 Oct 2010 09:43:06 +0800 Li Zefan l...@cn.fujitsu.com wrote: Stephen Hemminger wrote: On Tue, 19 Oct 2010 18:14:10 -0700 Paul Menage men...@google.com wrote: On Tue, Oct 19, 2010 at 6:12 PM, Stephen Hemminger shemmin...@vyatta.com wrote: Where

[Devel] Re: [PATCH 2/4] Kconfig: remove pointless cgroup dependency

2010-10-13 Thread Li Zefan
Daniel Lezcano wrote: The different cgroup subsystems are under the cgroup submenu. The dependency between the cgroups and the menu subsystems is pointless. Indead. Signed-off-by: Daniel Lezcano daniel.lezc...@free.fr Acked-by: Li Zefan l...@cn.fujitsu.com --- init/Kconfig | 14

[Devel] Re: [PATCH] cgroups: fix API thinko

2010-08-17 Thread Li Zefan
...@redhat.com Acked-by: Li Zefan l...@cn.fujitsu.com I also don't like the name, but I'm not good at English or naming. ;) --- Paul, Li, Sridhar, could you please review the following patch? I only compile-tested it due to travel, but looks straight-forward to me. Alex Williamson

[Devel] Re: [PATCH 2/3] cgroup : make the mount options parsing more accurate

2010-08-03 Thread Li Zefan
-by: Serge E. Hallyn serge.hal...@canonical.com Cc: Eric W. Biederman ebied...@xmission.com Cc: Paul Menage men...@google.com Reviewed-by: Li Zefan l...@cn.fujitsu.com ___ Containers mailing list contain...@lists.linux-foundation.org https://lists.linux

[Devel] Re: [PATCH 3/3] cgroup : remove the ns_cgroup

2010-08-03 Thread Li Zefan
...@xmission.com Cc: Paul Menage men...@google.com Cc: Jamal Hadi Salim h...@cyberus.ca Reviewed-by: Li Zefan l...@cn.fujitsu.com ___ Containers mailing list contain...@lists.linux-foundation.org https://lists.linux-foundation.org/mailman/listinfo/containers

[Devel] Re: [PATCH 1/3] cgroup : add clone_children control file

2010-08-03 Thread Li Zefan
...@google.com Reviewed-by: Li Zefan l...@cn.fujitsu.com ___ Containers mailing list contain...@lists.linux-foundation.org https://lists.linux-foundation.org/mailman/listinfo/containers ___ Devel mailing list Devel

[Devel] Re: [PATCH v4 0/2] cgroups: implement moving a threadgroup's threads atomically with cgroup.procs

2010-08-03 Thread Li Zefan
Andrew Morton wrote: On Fri, 30 Jul 2010 19:56:49 -0400 Ben Blum bb...@andrew.cmu.edu wrote: This patch series implements a write function for the 'cgroup.procs' per-cgroup file, which enables atomic movement of multithreaded applications between cgroups. Writing the thread-ID of any thread

[Devel] Re: [PATCH] Documentation: cgroups/cpuacct.txt: Fix command example in cpuacct.txt.

2010-08-03 Thread Li Zefan
Masanari Iida wrote: Fix command example in cpuacct.txt Signed-off-by: Masanari Iida standby2...@gmail.com Obviously correct.. Acked-by: Li Zefan l...@cn.fujitsu.com --- Documentation/cgroups/cpuacct.txt |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git

[Devel] Re: [PATCH] cgroup: alloc_css_id() increments hierarchy depth

2010-05-30 Thread Li Zefan
Catch. Acked-by: KAMEZAWA Hiroyuki kamezawa.hir...@jp.fujitsu.com But, who breaks this ? Do we need backport this against old kernels ? Oops, I broke it, and it needs to be backported to 2.6.34.. Thanks for catching this! Acked-by: Li Zefan l...@cn.fujitsu.com

[Devel] Re: [PATCH] cgroup: alloc_css_id() increments hierarchy depth

2010-05-30 Thread Li Zefan
On Fri, May 28, 2010 at 8:16 AM, Greg Thelen gthe...@google.com wrote: Signed-off-by: Greg Thelen gthe...@google.com Acked-by: Paul Menage men...@google.com Good catch, thanks. Nice Catch. Acked-by: KAMEZAWA Hiroyuki kamezawa.hir...@jp.fujitsu.com But, who breaks this ? Do we need

[Devel] [PATCH 1/5] cgroup: Fix an RCU warning in cgroup_path()

2010-04-22 Thread Li Zefan
or cgroup_mutex held. Signed-off-by: Li Zefan l...@cn.fujitsu.com --- kernel/cgroup.c | 12 +--- 1 files changed, 9 insertions(+), 3 deletions(-) diff --git a/kernel/cgroup.c b/kernel/cgroup.c index e2769e1..4ca928d 100644 --- a/kernel/cgroup.c +++ b/kernel/cgroup.c @@ -1646,7 +1646,9

[Devel] [PATCH 2/5] cgroup: Fix an RCU warning in alloc_css_id()

2010-04-22 Thread Li Zefan
With CONFIG_PROVE_RCU=y, a warning can be triggered: # mount -t cgroup -o memory xxx /mnt # mkdir /mnt/0 ... kernel/cgroup.c:4442 invoked rcu_dereference_check() without protection! ... This is a false-positive. It's safe to directly access parent_css-id. Signed-off-by: Li Zefan l

[Devel] [PATCH 3/5] sched: Fix an RCU warning in print_task()

2010-04-22 Thread Li Zefan
With CONFIG_PROVE_RCU=y, a warning can be triggered: $ cat /proc/sched_debug ... kernel/cgroup.c:1649 invoked rcu_dereference_check() without protection! ... Both cgroup_path() and task_group() should be called with either rcu_read_lock or cgroup_mutex held. Signed-off-by: Li Zefan l

[Devel] [PATCH 4/5] freezer cgroup: Fix an RCU warning in cgroup_freezing_or_frozen()

2010-04-22 Thread Li Zefan
with CONFIG_PROVE_RCU, a warning can be triggered when we resume from suspend: ... include/linux/cgroup.h:533 invoked rcu_dereference_check() without protection! ... task_freezer() calls task_subsys_state(), which needs to be protected by rcu_read_lock or cgroup_mutex. Signed-off-by: Li Zefan l

[Devel] [PATCH 5/5] blk-cgroup: Fix an RCU warning in blkiocg_create()

2010-04-22 Thread Li Zefan
. Signed-off-by: Li Zefan l...@cn.fujitsu.com --- block/blk-cgroup.c |8 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c index 5fe03de..2cc682b 100644 --- a/block/blk-cgroup.c +++ b/block/blk-cgroup.c @@ -286,16 +286,16 @@ done: static

[Devel] Re: [PATCH 4/5] freezer cgroup: Fix an RCU warning in cgroup_freezing_or_frozen()

2010-04-22 Thread Li Zefan
-by: Li Zefan l...@cn.fujitsu.com --- kernel/cgroup_freezer.c |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/kernel/cgroup_freezer.c b/kernel/cgroup_freezer.c index 5038f4c..ac76983 100644 --- a/kernel/cgroup_freezer.c +++ b/kernel/cgroup_freezer.c @@ -53,6 +53,7

[Devel] [PATCH] cgroup: Check task_lock in task_subsys_state()

2010-04-22 Thread Li Zefan
task_subsys_state() is safe under task_lock(). See Documentation/cgroups/cgroups.txt for locking rule. This fixes an RCU warning when resume from suspend. The warning comes from freezer cgroup in cgroup_freezing_or_frozen(). Signed-off-by: Li Zefan l...@cn.fujitsu.com --- I'm not sure which

[Devel] Re: [PATCH] block: make CONFIG_BLK_CGROUP visible

2010-03-15 Thread Li Zefan
---help--- Generic block IO controller cgroup interface. This is the common @@ -91,7 +92,7 @@ config BLK_CGROUP to such task groups. config DEBUG_BLK_CGROUP -bool +bool Block cgroup debugging help Why are you making DEBUG_BLK_CGROUP this as a user

[Devel] Re: [PATCH] block: make CONFIG_BLK_CGROUP visible

2010-03-15 Thread Li Zefan
Jens Axboe wrote: On Mon, Mar 15 2010, Li Zefan wrote: Make the config visible, so we can choose from CONFIG_BLK_CGROUP=y and CONFIG_BLK_CGROUP=m when CONFIG_IOSCHED_CFQ=m. Signed-off-by: Li Zefan l...@cn.fujitsu.com What kernel is this against? It's against linus' tree. I've just

[Devel] [PATCH] block: make CONFIG_BLK_CGROUP visible

2010-03-14 Thread Li Zefan
Make the config visible, so we can choose from CONFIG_BLK_CGROUP=y and CONFIG_BLK_CGROUP=m when CONFIG_IOSCHED_CFQ=m. Signed-off-by: Li Zefan l...@cn.fujitsu.com --- block/Kconfig |5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/block/Kconfig b/block/Kconfig index

[Devel] [PATCH] cgroups: remove duplicate include

2010-03-14 Thread Li Zefan
commit e6a1105b (cgroups: subsystem module loading interface) and commit c50cc752 (sched, cgroups: Fix module export) result in duplicate including of cgroup.h Signed-off-by: Li Zefan l...@cn.fujitsu.com --- kernel/cgroup.c |1 - 1 files changed, 0 insertions(+), 1 deletions(-) diff --git

[Devel] Re: [PATCH] cgroup: do not use dprintf in cgroup_event_listener

2010-02-26 Thread Li Zefan
Kirill A. Shutemov wrote: glibc's dprintf(3) is buggy: http://sourceware.org/bugzilla/show_bug.cgi?id=11319 Let's not to use it in the example. Signed-off-by: Kirill A. Shutemov kir...@shutemov.name Reviewed-by: Li Zefan l...@cn.fujitsu.com

[Devel] Re: [PATCH -mm] cgroups: fix failure path in cgroup_write_event_control()

2010-02-24 Thread Li Zefan
Kirill A. Shutemov wrote: On Wed, Feb 24, 2010 at 5:22 AM, Li Zefan l...@cn.fujitsu.com wrote: How to reproduce: # mount -t cgroup -o memory xxx /cgroup # mkdir /cgroup/tmp # ./cgroup_event_listener /cgroup/tmp/cgroup.event_control abc ^C # rmdir /cgroup/tmp # cat /proc/cgroups

[Devel] [PATCH -mm] cgroups: fix failure path in cgroup_write_event_control()

2010-02-23 Thread Li Zefan
!) Using a single goto label to cleanup multi failure paths can get things wrong quite easily, while multi labels makes the code cleaner. Signed-off-by: Li Zefan l...@cn.fujitsu.com --- cgroup.c | 39 ++- 1 file changed, 18 insertions(+), 21 deletions(-) diff

[Devel] Re: [PATCH v2 -mmotm 3/4] cgroups: Add simple listener of cgroup events to documentation

2010-02-23 Thread Li Zefan
+ ret = dprintf(event_control, %d %d %s, efd, cfd, argv[2]); I found it won't return negative value for invalid input, though errno is set properly. try: # ./cgroup_event_listner /cgroup/cgroup.procs abc while strace shows write() does return -1: # strace ./cgroup_event_listner

[Devel] Re: [PATCH v2 -mmotm 1/4] cgroups: Fix race between userspace and kernelspace

2010-02-22 Thread Li Zefan
exists. To avoid race beetween userspace and kernelspace we have to notify userspace about cgroup removing only after rmdir of cgroup directory. Signed-off-by: Kirill A. Shutemov kir...@shutemov.name Reviewed-by: KAMEZAWA Hiroyuki kamezawa.hir...@jp.fujitsu.com Acked-by: Li Zefan l

[Devel] Re: [PATCH v2 -mmotm 2/4] cgroups: remove events before destroying subsystem state objects

2010-02-22 Thread Li Zefan
...@jp.fujitsu.com Looks good. Acked-by: Li Zefan l...@cn.fujitsu.com ___ Containers mailing list contain...@lists.linux-foundation.org https://lists.linux-foundation.org/mailman/listinfo/containers ___ Devel

[Devel] Re: [PATCH v2 -mmotm 3/4] cgroups: Add simple listener of cgroup events to documentation

2010-02-22 Thread Li Zefan
Kirill A. Shutemov wrote: An example of cgroup notification API usage. Signed-off-by: Kirill A. Shutemov kir...@shutemov.name Reviewed-by: KAMEZAWA Hiroyuki kamezawa.hir...@jp.fujitsu.com Acked-by: Li Zefan l...@cn.fujitsu.com ___ Containers

[Devel] [PATCH 2/2] cgroups: Clean up cgroup_pidlist_find() a bit

2010-01-26 Thread Li Zefan
Don't Call get_pid_ns() before we locate/alloc the ns. Signed-off-by: Li Zefan l...@cn.fujitsu.com --- cgroup.c |8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) --- a/kernel/cgroup.c.orig 2010-01-26 14:24:29.0 +0800 +++ a/kernel/cgroup.c 2010-01-26 14:24

[Devel] Re: [PATCH v2 2/2] cgroups: blkio subsystem as module

2010-01-14 Thread Li Zefan
Jens Axboe wrote: On Tue, Jan 12 2010, Ben Blum wrote: Convert blk-cgroup to be buildable as a module From: Ben Blum bb...@andrew.cmu.edu This patch modifies the Block I/O cgroup subsystem to be able to be built as a module. As the CFQ disk scheduler optionally depends on blk-cgroup,

[Devel] Re: [PATCH v5 1/4] cgroup: implement eventfd-based generic API for notifications

2010-01-07 Thread Li Zefan
Kirill A. Shutemov wrote: On Thu, Jan 7, 2010 at 3:01 AM, Paul Menage men...@google.com wrote: On Wed, Dec 30, 2009 at 7:57 AM, Kirill A. Shutemov kir...@shutemov.name wrote: + + if (!IS_ERR(efile)) + fput(efile); While this is OK currently, it's a bit fragile. efile

[Devel] Re: [PATCH v4 0/4] cgroups: support for module-loadable subsystems

2010-01-06 Thread Li Zefan
KAMEZAWA Hiroyuki wrote: On Wed, 6 Jan 2010 20:26:06 -0500 Ben Blum bb...@andrew.cmu.edu wrote: On Wed, Jan 06, 2010 at 04:04:14PM -0800, Andrew Morton wrote: On Thu, 31 Dec 2009 00:10:50 -0500 Ben Blum bb...@andrew.cmu.edu wrote: This patch series implements support for building,

[Devel] Re: [PATCH 2/4] cgroups: subsystem module loading interface

2009-12-28 Thread Li Zefan
+ write_lock(css_set_lock); + for (i = 0; i CSS_SET_TABLE_SIZE; i++) { + struct css_set *cg; + struct hlist_node *node, *tmp; + struct hlist_head *bucket = css_set_table[i], *new_bucket; Please add a blank line between variable declaration and other code.

[Devel] Re: [PATCH 1/4] cgroups: revamp subsys array

2009-12-27 Thread Li Zefan
subsystems are not present or may appear/disappear. Signed-off-by: Ben Blum bb...@andrew.cmu.edu Acked-by: Li Zefan l...@cn.fujitsu.com ... A small nitpick: +/* This define indicates the maximum number of subsystems that can be loaded + * at once. We limit to this many since cgroupfs_root

[Devel] Re: [PATCH 2/4] cgroups: subsystem module loading interface

2009-12-27 Thread Li Zefan
pointer in struct cgroup_subsys. Several functions that might be wanted by modules have had EXPORT_SYMBOL added to them, but it's unclear exactly which functions want it and which won't. Signed-off-by: Ben Blum bb...@andrew.cmu.edu Acked-by: Li Zefan l...@cn.fujitsu.com Some small nitpicks

[Devel] Re: [PATCH 3/4] cgroups: net_cls as module

2009-12-27 Thread Li Zefan
the subsys_id to be either declared as a compile-time constant by the cgroup_subsys.h include in cgroup.h, or, if it's a module, initialized within the struct by cgroup_load_subsys. Signed-off-by: Ben Blum bb...@andrew.cmu.edu Acked-by: Li Zefan l...@cn.fujitsu.com But can we reorder this patch

[Devel] Re: [PATCH 4/4] cgroups: subsystem module unloading

2009-12-27 Thread Li Zefan
time) to once per attached hierarchy (in parse_cgroupfs_options and rebind_subsystems) (i.e., 0 or 1). It also adds a proper module_delete call in net/sched/cls_cgroup.c. Signed-off-by: Ben Blum bb...@andrew.cmu.edu Acked-by: Li Zefan l...@cn.fujitsu.com Also please fix comment style

[Devel] Re: [PATCH] cgroups: fix 2.6.32 regression causing BUG_ON() in cgroup_diput()

2009-12-23 Thread Li Zefan
by the list's mutex. Signed-off-by: Dave Anderson ander...@redhat.com Reviewed-by: Li Zefan l...@cn.fujitsu.com ___ Containers mailing list contain...@lists.linux-foundation.org https://lists.linux-foundation.org/mailman/listinfo/containers

[Devel] Re: [PATCH RFC v2 1/4] cgroup: implement eventfd-based generic API for notifications

2009-12-15 Thread Li Zefan
Kirill A. Shutemov wrote: This patch introduces write-only file cgroup.event_control in every cgroup. To register new notification handler you need: - create an eventfd; - open a control file to be monitored. Callbacks register_event() and unregister_event() must be defined for the

[Devel] Re: [PATCH RFC v2 1/4] cgroup: implement eventfd-based generic API for notifications

2009-12-15 Thread Li Zefan
+/* + * Check if a file is a control file + */ +static inline struct cftype *__file_cft(struct file *file) +{ +if (file-f_dentry-d_inode-i_fop != cgroup_file_operations) +return ERR_PTR(-EINVAL); I don't think this check is needed. Sorry, please ignore this comment

[Devel] Re: [RFC] [PATCH 1/5] cgroups: revamp subsys array

2009-12-09 Thread Li Zefan
@@ -1291,6 +1324,7 @@ static int cgroup_get_sb(struct file_system_type *fs_type, struct cgroupfs_root *new_root; /* First find the desired set of subsystems */ + down_read(subsys_mutex); Hmm.. this can lead to deadlock. sget() returns success with sb-s_umount held, so here we have:

[Devel] Re: [RFC] [PATCH 1/5] cgroups: revamp subsys array

2009-12-09 Thread Li Zefan
How does this sound as a possible solution, in cgroup_get_sb: 1) Take subsys_mutex 2) Call parse_cgroupfs_options() 3) Drop subsys_mutex 4) Call sget(), which gets sb-s_umount without subsys_mutex held 5) Take subsys_mutex 6) Call verify_cgroupfs_options() 7) Proceed as normal In which

[Devel] Re: [RFC] [PATCH 5/5] cgroups: subsystem dependencies

2009-12-08 Thread Li Zefan
Ben Blum wrote: On Tue, Dec 08, 2009 at 02:11:21PM +0800, Li Zefan wrote: This patch adds a mechanism with which a subsystem can specify dependencies on other subsystems. Since subsystems can come and go, it would not be useful to refer to a depended-upon subsystem by subsys_id, so instead

[Devel] Re: [RFC] [PATCH 1/5] cgroups: revamp subsys array

2009-12-08 Thread Li Zefan
Fix To and Cc.. Li Zefan wrote: Ben Blum wrote: On Tue, Dec 08, 2009 at 03:38:43PM +0800, Li Zefan wrote: @@ -1291,6 +1324,7 @@ static int cgroup_get_sb(struct file_system_type *fs_type, struct cgroupfs_root *new_root; /* First find the desired set of subsystems */ + down_read

[Devel] Re: [RFC] [PATCH 1/5] cgroups: revamp subsys array

2009-12-08 Thread Li Zefan
Ben Blum wrote: On Tue, Dec 08, 2009 at 03:38:43PM +0800, Li Zefan wrote: @@ -1291,6 +1324,7 @@ static int cgroup_get_sb(struct file_system_type *fs_type, struct cgroupfs_root *new_root; /* First find the desired set of subsystems */ + down_read(subsys_mutex); Hmm.. this can

[Devel] Re: [RFC] [PATCH 3/5] cgroups: net_cls as module

2009-12-07 Thread Li Zefan
+struct cgroup_subsys net_cls_subsys = { + .name = net_cls, + .create = cgrp_create, + .destroy= cgrp_destroy, + .populate = cgrp_populate, +#ifdef CONFIG_NET_CLS_CGROUP + .subsys_id = net_cls_subsys_id, +#else +#define

[Devel] Re: [RFC] [PATCH 5/5] cgroups: subsystem dependencies

2009-12-07 Thread Li Zefan
This patch adds a mechanism with which a subsystem can specify dependencies on other subsystems. Since subsystems can come and go, it would not be useful to refer to a depended-upon subsystem by subsys_id, so instead a NULL-terminated array of strings must be specified. Validation is done by

[Devel] Re: [RFC] [PATCH 1/5] cgroups: revamp subsys array

2009-12-07 Thread Li Zefan
@@ -1291,6 +1324,7 @@ static int cgroup_get_sb(struct file_system_type *fs_type, struct cgroupfs_root *new_root; /* First find the desired set of subsystems */ + down_read(subsys_mutex); Hmm.. this can lead to deadlock. sget() returns success with sb-s_umount held, so

[Devel] Re: [PATCH 5/6] Makes procs file writable to move all threads by tgid at once

2009-11-10 Thread Li Zefan
Hi Ben, The current code (with or without your patch) may lead to an error because the fork hook can fail and the exit hook is called in all the cases making the fork / exit asymmetric. The _current_ code won't lead to this error, because the fork hook can't fail. Right, as no

  1   2   3   4   >