Re: [Devel] [PATCH cgroup/for-3.14] cgroup: fix fail path in cgroup_load_subsys()

2013-12-12 Thread Li Zefan
skipping calls to offline_css() and > css_free() in cgroup_unload_subsys() if there is no css, and freeing css > in cgroup_load_subsys() on online_css() failure. > > Signed-off-by: Vladimir Davydov I don't have strong preference on wh

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

2013-12-11 Thread Li Zefan
> cgroup_subsys *ss) > } > write_unlock(&css_set_lock); > > - ret = online_css(css); > - if (ret) > - goto err_unload; > - Moving online_css() upwards should be fine. Acked-by: Li Zefan > /* success! */ >

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 er

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

2012-04-25 Thread Li Zefan
p, and the cgroup is declared >>>dead (cgroup_is_removed() == true) >>> >>> [v2: don't cgroup_lock the freezer and blkcg ] >>> >>> Signed-off-by: Glauber Costa >>> CC: Tejun Heo >>> CC: Li Zefan >>> CC: Kamezawa Hi

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

2012-04-20 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 >>> l

[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

[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: [RFC] cgroup basic comounting

2011-12-19 Thread Li Zefan
et me know if this is tuned with the idea you had in mind. > If this is okay, I patch that extracts usage from cpu cgroup data > in case of comount would follow. > > Signed-off-by: Glauber Costa > CC: Paul Turner > CC: Li Zefan > --- > kernel/cgroup.c |4 ++-- >

[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" pref

[Devel] Re: [PATCH 2/3] make clone_children a flag

2011-12-13 Thread Li Zefan
Tejun Heo wrote: > On Sun, Dec 11, 2011 at 03:45:37PM +0100, Glauber Costa wrote: >> There is no reason to have a flags field, and then a separate >> bool field just to indicate if the clone_children flag is set. >> Make it a flag >> >> Signed-off-by: Glauber Costa > > Doesn't this change how rem

[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 Cos

[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 t

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

2011-02-24 Thread Li Zefan
i Olsa Normally you should retain reviewed-by and other tags that you've got previously. So here again: Reviewed-by: Li Zefan ___ Containers mailing list contain...@lists.linux-foundation.org https://lists.linux-fo

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

2011-02-24 Thread Li Zefan
lock_held() condition. > > wbr, > jirka and this should be excluded from the changelog. > > > Signed-off-by: Jiri Olsa Reviewed-by: Li Zefan However a nitpick: > --- > include/linux/cgroup.h |1 - > kernel/cgroup.c|6 ++ > 2 files change

[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 wrote: > >> jacob.jun@linux.intel.com wrote: >>> From: Jacob Pan >>> >>> Freezer subsystem is used to manage batch jobs which can start >>> stop at the same time. However, so

[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 > > 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 example, if we want to r

[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 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 for some time for

[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 0df6a63f8735a7c8a877878bc215

[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 Date: Tue Dec 21 13:29:29 2010 -0500 switch cgroup switching it to s_d_op allows to kill the cgroup_lookup() klu

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

2011-01-13 Thread Li Zefan
;> [ 85.102009] [] ? sysret_check+0x27/0x62 >> [ 85.102009] [] ? trace_hardirqs_on_caller+0x117/0x13b >> [ 85.102009] [] ? trace_hardirqs_on_thunk+0x3a/0x3f >> [ 85.102009] [] ? sys_rmdir+0x11/0x13 >> [ 85.102009] [] ? system_call_fastpath+0x16/0x1b >&g

[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: > >>> This needs to be done with cgroup_lock() instead of callback_mutex since >>> the post_clone() callback will store to cs->mems_allowed on >>> cgroup_clone(). >>> >> Then cpuset

[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

[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 traditional

[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 >>> cgro

[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 --- Documentation/cgroups/cgroups.txt | 37 + 1 files changed, 29 insertions(+), 8 deletions(-) diff --git a/Documentation/cgroups/cgroups.txt b/Documentation/cgroups

[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 --- kernel/cgroup.c |6 +- k

[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 --- include/linux/cgroup.h |7 +-- kernel/cgroup.c|5 + 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/include/linux/cgroup.h b/include/linux

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

2010-12-15 Thread Li Zefan
ags. Signed-off-by: Li Zefan --- 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 100644 --- a/incl

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

2010-12-15 Thread Li Zefan
one() for newly-created css. Signed-off-by: Li Zefan --- include/linux/cgroup.h |5 + kernel/cgroup.c| 273 ++-- 2 files changed, 221 insertions(+), 57 deletions(-) diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h index 63d953

[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 Signed-off-by: Li Zefan --- 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

[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 per-

[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 > -b

[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 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 upd

[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 file

[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 Tue, Nov 9, 2010 at 4:52 PM, Li Zefan 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 momen

[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 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

[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)

[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 wrote: >> + /* >> +* Indicate if this subsystem can be bound/unbound to/from a cgroup >> +* hierarchy which has child cgroups. >> +*/ >> + unsigned int can_bind:

[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 wrote: >> On x86_32, sizeof(struct cgroup_subsys) shrinks from 276 bytes >> to 264. >> >> Signed-off-by: Li Zefan > > Acked-by: Paul Menage > > Maybe use &qu

[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: >> + *a1

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

2010-10-24 Thread Li Zefan
Matt Helsley wrote: > On Fri, Oct 22, 2010 at 04:11:41PM +0800, Li Zefan wrote: >> To make it bindable, we need to thaw all processes when unbinding >> the freezer subsystem from a cgroup hierarchy. >> >> Signed-off-by: Li Zefan > > Based on experience using cg

[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 wit

[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 &

[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 wrote: >> >>> Provide a usage example, and update the bind() callback API. >>> >>> Signed-off-by: Li Zefan >>> --- >>> Documentation/

[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 wrote: > >> Provide a usage example, and update the bind() callback API. >> >> Signed-off-by: Li Zefan >> --- >> Documentation/cgroups/cgroups.txt | 26 +- &

[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 --- Documentation/cgroups/cgroups.txt | 26 +- 1 files changed, 17 insertions(+), 9 deletions(-) diff --git a/Documentation/cgroups/cgroups.txt b/Documentation/cgroups/cgroups.txt

[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 --- include/linux/cgroup.h |7 +-- kernel/cgroup.c|3 +++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h

[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 --- include/linux/cgroup.h |3 ++- kernel/cgroup.c | 22 -- kernel/cgroup_freezer.c | 19 +-- 3 files

[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 --- kernel/cgroup.c |1 + kernel/sched.c |1 + net/sched/cls_cgroup.c |1 + security/device_cgroup.c |1 + 4 files changed, 4

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

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

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

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

[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 --- 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 100644 --- a/include

[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 per-

[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 wrote: > >> Stephen Hemminger wrote: >>> On Tue, 19 Oct 2010 18:14:10 -0700 >>> Paul Menage wrote: >>> >>>> On Tue, Oct 19, 2010 at 6:12 PM, Stephen Hemmi

[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 wrote: > >> On Tue, Oct 19, 2010 at 6:12 PM, Stephen Hemminger >> wrote: >>> Where is it stored in an array? >>> >>> ~/kernel/linux-2.6$ git grep debug_subsys >>> kernel/cgroup.c:kfree(cont->subsys[debug_subsys_i

[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 w

[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 Acked-by: Li Zefan > --- > init/Kconfig | 14 --

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

2010-08-17 Thread Li Zefan
rent_cg to avoid > breaking bisect. > > Signed-off-by: Michael S. Tsirkin Acked-by: Li Zefan 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-

[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 Obviously correct.. Acked-by: Li Zefan > --- > Documentation/cgroups/cpuacct.txt |2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/Documentation/

[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 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 in a >> thr

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

2010-08-03 Thread Li Zefan
; > At present, the cpuset is the only one which had implemented the post_clone > callback. > > The option can be set at mount time by specifying the 'clone_children' mount > option. > > Signed-off-by: Daniel Lezcano > Signed-off-

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

2010-08-03 Thread Li Zefan
S references. > > Signed-off-by: Daniel Lezcano > Signed-off-by: Serge E. Hallyn > Cc: Eric W. Biederman > Cc: Paul Menage > Cc: Jamal Hadi Salim Reviewed-by: Li Zefan ___ Containers mailing list contain...@lists.linux-foundation.

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

2010-08-03 Thread Li Zefan
the loop. > > Signed-off-by: Daniel Lezcano > Signed-off-by: Serge E. Hallyn > Cc: Eric W. Biederman > Cc: Paul Menage Reviewed-by: Li Zefan ___ Containers mailing list contain...@lists.linux-foundation.org https://lists.linux-foundation.o

[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 wrote: > Signed-off-by: Greg Thelen Acked-by: Paul Menage Good catch, thanks. >>> Nice Catch. >>> Acked-by: KAMEZAWA Hiroyuki >>> >>> But, who breaks this ? Do we need backport this against old kernels ? >>> >> http://git

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

2010-05-30 Thread Li Zefan
Catch. > Acked-by: KAMEZAWA Hiroyuki > > 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 ___ Containers mailing

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

2010-05-06 Thread Li Zefan
Paul E. McKenney wrote: > On Thu, Apr 22, 2010 at 05:32:28PM +0800, Li Zefan wrote: >> with CONFIG_PROVE_RCU=y, a warning can be triggered: >> >> # mount -t cgroup -o blkio xxx /mnt >> # mkdir /mnt/subgroup >> >> ... >> kernel/cgroup.c:4442 invok

[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 --- I'm not sure which is preferable - a

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

2010-04-22 Thread Li Zefan
;>>> >>>> task_freezer() calls task_subsys_state(), which needs to be >>>> protected by rcu_read_lock or cgroup_mutex. >>>> >>>> Signed-off-by: Li Zefan >>>> --- >>>> kernel/cgroup_freezer.c |2 ++ >>>

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

2010-04-22 Thread Li Zefan
. Signed-off-by: Li Zefan --- 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 struct

[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

[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

[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:

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

2010-04-22 Thread Li Zefan
cgroup_mutex held. Signed-off-by: Li Zefan --- 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 @@ static inline struct

[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 > > What kernel is this against? > It's a

[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 a

[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 module.h Signed-off-by: Li Zefan --- Fix changelog... --- kernel/cgroup.c |1 - 1 files changed, 0 insertions(+),

[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 --- kernel/cgroup.c |1 - 1 files changed, 0 insertions(+), 1 deletions(-)

[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 --- block/Kconfig |5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/block/Kconfig b/block/Kconfig index 62a5921..906950c

[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 Reviewed-by: Li Zefan ___ Con

[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 wrote: >> How to reproduce: >> >> # mount -t cgroup -o memory xxx /cgroup >> # mkdir /cgroup/tmp >> # ./cgroup_event_listener /cgroup/tmp/cgroup.event_control abc >> ^C >> # rmd

[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 /cgroup/

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

2010-02-23 Thread Li Zefan
(failed!) 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 --- cgroup.c | 39 ++- 1 file changed, 18 insertions(+), 21 deletions(-) diff --gi

[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 > Reviewed-by: KAMEZAWA Hiroyuki Acked-by: Li Zefan ___ Containers mailing list contain...@lists.linux-foundation.org https:/

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

2010-02-22 Thread Li Zefan
Kirill A. Shutemov wrote: > Events should be removed after rmdir of cgroup directory, but before > destroying subsystem state objects. Let's take reference to cgroup > directory dentry to do that. > > Signed-off-by: Kirill A. Shutemov > Acked-by: KAMEZAWA Hiroyuki Lo

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

2010-02-22 Thread Li Zefan
k if the cgroup > still 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 > Reviewed-by: KAMEZ

[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 --- 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:44.0

[Devel] [PATCH 1/2] cgroups: Fix to return errno in a failure path

2010-01-26 Thread Li Zefan
) # mount -t cgroup -o blkio xxx /mnt # for ((i = 0; i < 65534; i++)); do mkdir /mnt/$i; done # mkdir /mnt/65534 (should return ENOSPC) # Signed-off-by: Li Zefan --- cgroup.c |7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) --- a/kernel/cgroup.c.orig 2010-01-19 16

[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 >> >> 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, config >>

[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 wrote: >> On Wed, Dec 30, 2009 at 7:57 AM, Kirill A. Shutemov >> wrote: >>> + >>> + if (!IS_ERR(efile)) >>> + fput(efile); >> While this is OK currently, it's a bit fragile. efile starts as NULL, >> and IS

[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 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 wrote: >>> This patch series implements support for building, loading, and unloading su

[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 declaratio

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

2009-12-27 Thread Li Zefan
nce (at load 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 Acked-by: Li Zefan Also please fix commen

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

2009-12-27 Thread Li Zefan
o allow 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 Acked-by: Li Zefan But can w

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

2009-12-27 Thread Li Zefan
uct module 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 Acked-by: Li Zefan Some small nit

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

2009-12-27 Thread Li Zefan
andle when subsystems are not present or may appear/disappear. > > Signed-off-by: Ben Blum Acked-by: Li Zefan ... 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 has subsys_b

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

2009-12-23 Thread Li Zefan
the use_count increment when a matching > pidlist is found by cgroup_pidlist_find(), because it gets bumped by > the calling pidlist_array_load() function while still protected by the > list's mutex. > > Signed-off-by: Dave Anderson > Reviewed-by: Li Zefan __

[Devel] Re: Fw: cgroups and dbus

2009-12-22 Thread Li Zefan
>> It seems what you asked was an example of cgroup. >> Maybe the simplest cgroup in the kernel is CONFIG_CGROUP_CPUACCT. >> (kernel/sched.c) The next one is CGROUP_DEVICE (security/device_cgroup.c) >> >> Documentation under Documentation/cgroups/ is always taken care to be >> updated. >> If you

[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 ign

  1   2   3   4   5   >