[PATCH v5 0/5] memcg, cgroup: kill css_id

2013-08-07 Thread Li Zefan
. - fixed the call to idr_alloc() in cgroup_init() in the first patch. Li Zefan (5): memcg: convert to use cgroup_is_descendant() memcg: convert to use cgroup id memcg: fail to create cgroup if the cgroup id is too big memcg: stop using css id cgroup: kill css_id

[PATCH v5 5/5] cgroup: kill css_id

2013-08-07 Thread Li Zefan
The only user of css_id was memcg, and it has been convered to use cgroup-id, so kill css_id. Signed-off-by: Li Zefan lize...@huwei.com Reviewed-by: Michal Hocko mho...@suse.cz Acked-by: Tejun Heo t...@kernel.org --- include/linux/cgroup.h | 37 kernel/cgroup.c| 252

[PATCH v5 3/5] memcg: fail to create cgroup if the cgroup id is too big

2013-08-07 Thread Li Zefan
memcg requires the cgroup id to be smaller than 65536. This is a preparation to kill css id. Signed-off-by: Li Zefan lize...@huawei.com Acked-by: Michal Hocko mho...@suse.cz --- mm/memcontrol.c | 9 + 1 file changed, 9 insertions(+) diff --git a/mm/memcontrol.c b/mm/memcontrol.c index

[PATCH v5 4/5] memcg: stop using css id

2013-08-07 Thread Li Zefan
Now memcg uses cgroup id instead of css id. Update some comments and set mem_cgroup_subsys-use_id to 0. Signed-off-by: Li Zefan lize...@huawei.com Acked-by: Michal Hocko mho...@suse.cz --- mm/memcontrol.c | 24 1 file changed, 8 insertions(+), 16 deletions(-) diff --git

Re: [PATCHSET cgroup/for-3.12] cgroup: make cgroup_event specific to memcg

2013-08-07 Thread Li Zefan
If somebody needs a notification interface (and there is no one available right now) then you cannot prevent from such a pointless work anyway... I'm gonna add one for freezer state transitions. It'll be simple this file changed thing and will probably apply that to at least oom and

Re: stable: a59f4e079d19464eebb9b06513a1d4f55fdae5ba needs backport ?

2013-08-07 Thread Li Zefan
Hi Greg, Could you queue this commit for 3.0 and 3.4? It has been acked by Ingo. On 2013/8/2 19:14, Ingo Molnar wrote: * Li Zefan lize...@huawei.com wrote: commit a59f4e079d19464eebb9b06513a1d4f55fdae5ba Author: Zhu Yanhai gaoyang@taobao.com Date: Tue Jan 8 12:56:52 2013 +0800

Re: [PATCH] kernel/sysctl_binary.c: improve the usage of return value 'result'

2013-08-06 Thread Li Zefan
>> The right answer to the code is to config it out and then you don't have >> to worry about it one way or another. >> > > Pardon? > > Excuse me, my English is not quite well, I don't quite understand your > meaning, could you please repeat again in details or say more clearly ? > > >> The

Re: [PATCH] kernel/sysctl_binary.c: improve the usage of return value 'result'

2013-08-06 Thread Li Zefan
The right answer to the code is to config it out and then you don't have to worry about it one way or another. Pardon? Excuse me, my English is not quite well, I don't quite understand your meaning, could you please repeat again in details or say more clearly ? The sysctl binary

Re: [PATCH v2 3/5] cgroup, memcg: move cgroup_event implementation to memcg

2013-08-05 Thread Li Zefan
On 2013/8/6 10:02, Li Zefan wrote: >> static struct cftype mem_cgroup_files[] = { >> { >> .name = "usage_in_bytes", >> @@ -5973,6 +6192,12 @@ static struct cftype mem_cgroup_files[] = { >>

Re: [PATCH v2 3/5] cgroup, memcg: move cgroup_event implementation to memcg

2013-08-05 Thread Li Zefan
> static struct cftype mem_cgroup_files[] = { > { > .name = "usage_in_bytes", > @@ -5973,6 +6192,12 @@ static struct cftype mem_cgroup_files[] = { > .read_u64 = mem_cgroup_hierarchy_read, > }, > { > + .name = "cgroup.event_control", > +

stable: please queue commit 0231bb5 ("perf: Fix event group context move")

2013-08-05 Thread Li Zefan
to kernels >= 3.0 && <= 3.7. -- Li Zefan -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/

stable: please queue commit 0231bb5 (perf: Fix event group context move)

2013-08-05 Thread Li Zefan
= 3.7. -- Li Zefan -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/

Re: [PATCH v2 3/5] cgroup, memcg: move cgroup_event implementation to memcg

2013-08-05 Thread Li Zefan
static struct cftype mem_cgroup_files[] = { { .name = usage_in_bytes, @@ -5973,6 +6192,12 @@ static struct cftype mem_cgroup_files[] = { .read_u64 = mem_cgroup_hierarchy_read, }, { + .name = cgroup.event_control, +

Re: [PATCH v2 3/5] cgroup, memcg: move cgroup_event implementation to memcg

2013-08-05 Thread Li Zefan
On 2013/8/6 10:02, Li Zefan wrote: static struct cftype mem_cgroup_files[] = { { .name = usage_in_bytes, @@ -5973,6 +6192,12 @@ static struct cftype mem_cgroup_files[] = { .read_u64 = mem_cgroup_hierarchy_read, }, { +.name

Re: [PATCH cgroup/for-3.12] cgroup: make css_for_each_descendant() and friends include the origin css in the iteration

2013-08-04 Thread Li Zefan
the rest. While the extra ref > operations aren't strictly necessary, this shouldn't cause any > noticeable difference. > > Signed-off-by: Tejun Heo > Cc: Li Zefan > Cc: Jens Axboe > Cc: Vivek Goyal > Cc: Matt Helsley > Cc: Johannes Weiner > Cc: Michal Hocko

Re: [PATCH 5/5] memcg: rename cgroup_event to mem_cgroup_event

2013-08-04 Thread Li Zefan
On 2013/8/5 0:07, Tejun Heo wrote: > cgroup_event is only available in memcg now. Let's brand it that way. > While at it, add a comment encouraging deprecation of the feature and > remove the respective section from cgroup documentation. > > This patch is cosmetic. > > Signed-off-by: Tejun Heo

Re: [PATCH 3/5] cgroup, memcg: move cgroup_event implementation to memcg

2013-08-04 Thread Li Zefan
于 2013/8/5 0:07, Tejun Heo 写道: > cgroup_event is way over-designed and tries to build a generic > flexible event mechanism into cgroup - fully customizable event > specification for each user of the interface. This is utterly > unnecessary and overboard especially in the light of the planned >

Re: [PATCH 2/5] cgroup: export __cgroup_from_dentry() and __cgroup_dput()

2013-08-04 Thread Li Zefan
> +struct cgroup *__cgroup_from_dentry(struct dentry *dentry, struct cftype > **cftp) > { > - if (file_inode(file)->i_fop != _file_operations) > - return ERR_PTR(-EINVAL); > - return __d_cft(file->f_dentry); > + if (!dentry->d_inode || > + dentry->d_inode->i_op !=

Re: [PATCH 2/5] cgroup: export __cgroup_from_dentry() and __cgroup_dput()

2013-08-04 Thread Li Zefan
+struct cgroup *__cgroup_from_dentry(struct dentry *dentry, struct cftype **cftp) { - if (file_inode(file)-i_fop != cgroup_file_operations) - return ERR_PTR(-EINVAL); - return __d_cft(file-f_dentry); + if (!dentry-d_inode || + dentry-d_inode-i_op !=

Re: [PATCH 3/5] cgroup, memcg: move cgroup_event implementation to memcg

2013-08-04 Thread Li Zefan
于 2013/8/5 0:07, Tejun Heo 写道: cgroup_event is way over-designed and tries to build a generic flexible event mechanism into cgroup - fully customizable event specification for each user of the interface. This is utterly unnecessary and overboard especially in the light of the planned unified

Re: [PATCH 5/5] memcg: rename cgroup_event to mem_cgroup_event

2013-08-04 Thread Li Zefan
On 2013/8/5 0:07, Tejun Heo wrote: cgroup_event is only available in memcg now. Let's brand it that way. While at it, add a comment encouraging deprecation of the feature and remove the respective section from cgroup documentation. This patch is cosmetic. Signed-off-by: Tejun Heo

Re: [PATCH cgroup/for-3.12] cgroup: make css_for_each_descendant() and friends include the origin css in the iteration

2013-08-04 Thread Li Zefan
, this shouldn't cause any noticeable difference. Signed-off-by: Tejun Heo t...@kernel.org Cc: Li Zefan lize...@huawei.com Cc: Jens Axboe ax...@kernel.dk Cc: Vivek Goyal vgo...@redhat.com Cc: Matt Helsley matth...@us.ibm.com Cc: Johannes Weiner han...@cmpxchg.org Cc: Michal Hocko mho...@suse.cz Cc

stable: a59f4e079d19464eebb9b06513a1d4f55fdae5ba needs backport ?

2013-08-02 Thread Li Zefan
commit a59f4e079d19464eebb9b06513a1d4f55fdae5ba Author: Zhu Yanhai Date: Tue Jan 8 12:56:52 2013 +0800 sched: Fix the broken sched_rr_get_interval() Without this patch, syscall sched_rr_get_interval() can return wrong value, and the bug was introduced in 2.6.24, so this looks like a

Re: [ 146/184] softirq: reduce latencies

2013-08-02 Thread Li Zefan
Cc: Ben Greear Cc: Tejun Hi Willy, This patch introduced a bug, which was then fixed by commit 34376a50fb1f ("Fix lockup related to stop_machine being stuck in __do_softirq."), do we need this fix for 2.6.32 ? On 2013/6/5 1:23, Willy Tarreau wrote: > 2.6.32-longterm review patch. If anyone has

Re: [ 146/184] softirq: reduce latencies

2013-08-02 Thread Li Zefan
Cc: Ben Greear Cc: Tejun Hi Willy, This patch introduced a bug, which was then fixed by commit 34376a50fb1f (Fix lockup related to stop_machine being stuck in __do_softirq.), do we need this fix for 2.6.32 ? On 2013/6/5 1:23, Willy Tarreau wrote: 2.6.32-longterm review patch. If anyone has

stable: a59f4e079d19464eebb9b06513a1d4f55fdae5ba needs backport ?

2013-08-02 Thread Li Zefan
commit a59f4e079d19464eebb9b06513a1d4f55fdae5ba Author: Zhu Yanhai gaoyang@taobao.com Date: Tue Jan 8 12:56:52 2013 +0800 sched: Fix the broken sched_rr_get_interval() Without this patch, syscall sched_rr_get_interval() can return wrong value, and the bug was introduced in 2.6.24, so

Re: [PATCH 21/23] cgroup: make cftype->[un]register_event() deal with cgroup_subsys_state instead of cgroup

2013-08-01 Thread Li Zefan
> @@ -506,15 +506,17 @@ struct cftype { >* you want to provide this functionality. Use eventfd_signal() >* on eventfd to send notification to userspace. >*/ > - int (*register_event)(struct cgroup *cgrp, struct cftype *cft, > - struct eventfd_ctx

Re: [PATCH 08/23] cgroup: pass around cgroup_subsys_state instead of cgroup in subsystem methods

2013-08-01 Thread Li Zefan
> @@ -4199,12 +4208,13 @@ static void init_cgroup_css(struct > cgroup_subsys_state *css, > /* invoke ->css_online() on a new CSS and mark it online if successful */ > static int online_css(struct cgroup_subsys *ss, struct cgroup *cgrp) > { > + struct cgroup_subsys_state *css =

Re: [PATCH 08/23] cgroup: pass around cgroup_subsys_state instead of cgroup in subsystem methods

2013-08-01 Thread Li Zefan
> @@ -4298,7 +4308,7 @@ static long cgroup_create(struct cgroup *parent, struct > dentry *dentry, > for_each_root_subsys(root, ss) { > struct cgroup_subsys_state *css; > > - css = ss->css_alloc(cgrp); > + css =

Re: [PATCH 16/23] cgroup: relocate cgroup_advance_iter()

2013-08-01 Thread Li Zefan
On 2013/8/2 5:49, Tejun Heo wrote: > For some reason, cgroup_advance_iter() is standing lonely all away > from its iter comrades. Relocate it. > There're some other functions that are in the same situation. Do you think it's better to relocate them, or just leave it as it is? -- To unsubscribe

Re: [PATCHSET cgroup/for-3.12] cgroup: use cgroup_subsys_state as the primary subsystem interface handle

2013-08-01 Thread Li Zefan
oup-remove-struct-cgroup_scanner.patch > 0020-cgroup-make-task-iterators-deal-with-cgroup_subsys_s.patch > 0021-cgroup-make-cftype-un-register_event-deal-with-cgrou.patch > 0022-cgroup-make-cgroup_taskset-deal-with-cgroup_subsys_s.patch > 0023-cgroup-unexport-cgroup_css.pat

Re: [PATCHSET cgroup/for-3.12] cgroup: use cgroup_subsys_state as the primary subsystem interface handle

2013-08-01 Thread Li Zefan
-unexport-cgroup_css.patch Looks good to me! Acked-by: Li Zefan lize...@huawei.com -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ

Re: [PATCH 16/23] cgroup: relocate cgroup_advance_iter()

2013-08-01 Thread Li Zefan
On 2013/8/2 5:49, Tejun Heo wrote: For some reason, cgroup_advance_iter() is standing lonely all away from its iter comrades. Relocate it. There're some other functions that are in the same situation. Do you think it's better to relocate them, or just leave it as it is? -- To unsubscribe

Re: [PATCH 08/23] cgroup: pass around cgroup_subsys_state instead of cgroup in subsystem methods

2013-08-01 Thread Li Zefan
@@ -4298,7 +4308,7 @@ static long cgroup_create(struct cgroup *parent, struct dentry *dentry, for_each_root_subsys(root, ss) { struct cgroup_subsys_state *css; - css = ss-css_alloc(cgrp); + css = ss-css_alloc(parent-subsys[ss-subsys_id]); As

Re: [PATCH 08/23] cgroup: pass around cgroup_subsys_state instead of cgroup in subsystem methods

2013-08-01 Thread Li Zefan
@@ -4199,12 +4208,13 @@ static void init_cgroup_css(struct cgroup_subsys_state *css, /* invoke -css_online() on a new CSS and mark it online if successful */ static int online_css(struct cgroup_subsys *ss, struct cgroup *cgrp) { + struct cgroup_subsys_state *css =

Re: [PATCH 21/23] cgroup: make cftype-[un]register_event() deal with cgroup_subsys_state instead of cgroup

2013-08-01 Thread Li Zefan
@@ -506,15 +506,17 @@ struct cftype { * you want to provide this functionality. Use eventfd_signal() * on eventfd to send notification to userspace. */ - int (*register_event)(struct cgroup *cgrp, struct cftype *cft, - struct eventfd_ctx *eventfd,

[PATCH v2 3/7] cgroup: restructure the failure path in cgroup_write_event_control()

2013-07-31 Thread Li Zefan
It uses a single label and checks the validity of each pointer. This is err-prone, and actually we had a bug because one of the check was insufficient. Use multi lables as we do in other places. v2: - drop initializations of local variables. Signed-off-by: Li Zefan --- kernel/cgroup.c | 39

[PATCH v2 4/7] cgroup: rename cgroup_pidlist->mutex

2013-07-31 Thread Li Zefan
It's a rw_semaphore not a mutex. Signed-off-by: Li Zefan --- kernel/cgroup.c | 22 +++--- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/kernel/cgroup.c b/kernel/cgroup.c index ae905a5..6662811 100644 --- a/kernel/cgroup.c +++ b/kernel/cgroup.c @@ -3436,7

Re: [PATCH 5/7] cgroup: remove struct cgroup_seqfile_state

2013-07-31 Thread Li Zefan
On 2013/7/31 19:35, Tejun Heo wrote: > On Wed, Jul 31, 2013 at 05:27:39PM +0800, Li Zefan wrote: >>> static int cgroup_seqfile_release(struct inode *inode, struct file *file) >>> { >>> - struct seq_file *seq = file->private_data; >>> - kfree(seq->

Re: [PATCH v2 5/5] cgroup: remove struct cgroup_seqfile_state

2013-07-31 Thread Li Zefan
On 2013/7/31 19:36, Tejun Heo wrote: > On Wed, Jul 31, 2013 at 05:36:25PM +0800, Li Zefan wrote: >> We can use struct cfent instead. >> >> v2: >> - remove cgroup_seqfile_release(). >> >> Signed-off-by: Li Zefan > > Applied to libata/for-3.12. >

Re: [PATCH 6/7] cgroup: rename current_css_set_cg_links

2013-07-31 Thread Li Zefan
On 2013/7/31 19:38, Tejun Heo wrote: > Hello, > > On Wed, Jul 31, 2013 at 04:18:07PM +0800, Li Zefan wrote: >> As we've renamed css_set->cg_links to css_set->cgrp_links (See commit >> 69d0206c79 "cgroup: bring some sanity to naming around cg_cgroup_link"), &g

[PATCH v2 5/5] cgroup: remove struct cgroup_seqfile_state

2013-07-31 Thread Li Zefan
We can use struct cfent instead. v2: - remove cgroup_seqfile_release(). Signed-off-by: Li Zefan --- kernel/cgroup.c | 45 + 1 file changed, 13 insertions(+), 32 deletions(-) diff --git a/kernel/cgroup.c b/kernel/cgroup.c index 0d378b1..c836dff

Re: [PATCH 5/7] cgroup: remove struct cgroup_seqfile_state

2013-07-31 Thread Li Zefan
> static int cgroup_seqfile_release(struct inode *inode, struct file *file) > { > - struct seq_file *seq = file->private_data; > - kfree(seq->private); > return single_release(inode, file); > } Oh, I just realized now we can remove cgroup_seqfile_release(). Will send out an

[PATCH 0/7] some pending cgroup patches

2013-07-31 Thread Li Zefan
The first one is a small bug fix, and the rest are pure cleanups. Li Zefan (7): cgroup: fix a leak when percpu_ref_init() fails cgroup: remove sparse tags from offline_css() cgroup: restructure the failure path in cgroup_write_event_control() cgroup: rename cgroup_pidlist

[PATCH 6/7] cgroup: rename current_css_set_cg_links

2013-07-31 Thread Li Zefan
e a cgroup subsystem, it's fine to change the interface. Signed-off-by: Li Zefan --- kernel/cgroup.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/kernel/cgroup.c b/kernel/cgroup.c index ac77d87..89d63b0 100644 --- a/kernel/cgroup.c +++ b/kernel/cgroup.c @@ -53

[PATCH 5/7] cgroup: remove struct cgroup_seqfile_state

2013-07-31 Thread Li Zefan
We can use struct struct cfent instead. Signed-off-by: Li Zefan --- kernel/cgroup.c | 38 -- 1 file changed, 12 insertions(+), 26 deletions(-) diff --git a/kernel/cgroup.c b/kernel/cgroup.c index 0d378b1..ac77d87 100644 --- a/kernel/cgroup.c +++ b/kernel

[PATCH 7/7] cgroup: more naming cleanups

2013-07-31 Thread Li Zefan
Constantly use @cset for css_set varabbles and use @cgrp as cgroup variables. Signed-off-by: Li Zefan --- include/linux/cgroup.h | 6 +++--- kernel/cgroup.c| 26 +- kernel/cpuset.c| 16 3 files changed, 24 insertions(+), 24 deletions

[PATCH 3/7] cgroup: restructure the failure path in cgroup_write_event_control()

2013-07-31 Thread Li Zefan
It uses a single label and checks the validity of each pointer. This is err-prone, and actually we once had a bug because one of the check was insufficient. Use multi lables as we do in other places. Signed-off-by: Li Zefan --- kernel/cgroup.c | 33 +++-- 1 file

[PATCH 4/7] cgroup: rename cgroup_pidlist->mutex

2013-07-31 Thread Li Zefan
It's a semaphore not a mutex. Signed-off-by: Li Zefan --- kernel/cgroup.c | 22 +++--- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/kernel/cgroup.c b/kernel/cgroup.c index f0d7f5d..0d378b1 100644 --- a/kernel/cgroup.c +++ b/kernel/cgroup.c @@ -3417,7 +3417,7

[PATCH 2/7] cgroup: remove sparse tags from offline_css()

2013-07-31 Thread Li Zefan
This should have been removed in commit d7eeac1913ff ("cgroup: hold cgroup_mutex before calling css_offline"). While at it, update the comments. Signed-off-by: Li Zefan --- kernel/cgroup.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/kernel/cgroup.

[PATCH 1/7] cgroup: fix a leak when percpu_ref_init() fails

2013-07-31 Thread Li Zefan
ss->css_free() is not called when perfcpu_ref_init() fails. Signed-off-by: Li Zefan --- kernel/cgroup.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/kernel/cgroup.c b/kernel/cgroup.c index a64b7b8..e60eba2 100644 --- a/kernel/cgroup.c +++ b/kernel/cgroup.c @@ -427

[PATCH 2/2] Staging: rtl8192u/ieee80211: add missing single_release()

2013-07-31 Thread Li Zefan
The debug file is opened with single_open(), but there's no single_release(). Signed-off-by: Li Zefan --- drivers/staging/rtl8192u/ieee80211/ieee80211_module.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c b/drivers

[PATCH 1/2] Staging: rtl8192e: add missing single_release()

2013-07-31 Thread Li Zefan
The debug file is opened with single_open(), but there's no single_release(). Signed-off-by: Li Zefan --- drivers/staging/rtl8192e/rtllib_module.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/staging/rtl8192e/rtllib_module.c b/drivers/staging/rtl8192e

[PATCH 1/2] Staging: rtl8192e: add missing single_release()

2013-07-31 Thread Li Zefan
The debug file is opened with single_open(), but there's no single_release(). Signed-off-by: Li Zefan lize...@huawei.com --- drivers/staging/rtl8192e/rtllib_module.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/staging/rtl8192e/rtllib_module.c b/drivers/staging

[PATCH 2/2] Staging: rtl8192u/ieee80211: add missing single_release()

2013-07-31 Thread Li Zefan
The debug file is opened with single_open(), but there's no single_release(). Signed-off-by: Li Zefan lize...@huawei.com --- drivers/staging/rtl8192u/ieee80211/ieee80211_module.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/staging/rtl8192u/ieee80211

[PATCH 2/7] cgroup: remove sparse tags from offline_css()

2013-07-31 Thread Li Zefan
This should have been removed in commit d7eeac1913ff (cgroup: hold cgroup_mutex before calling css_offline). While at it, update the comments. Signed-off-by: Li Zefan lize...@huawei.com --- kernel/cgroup.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/kernel/cgroup.c

[PATCH 1/7] cgroup: fix a leak when percpu_ref_init() fails

2013-07-31 Thread Li Zefan
ss-css_free() is not called when perfcpu_ref_init() fails. Signed-off-by: Li Zefan lize...@huawei.com --- kernel/cgroup.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/kernel/cgroup.c b/kernel/cgroup.c index a64b7b8..e60eba2 100644 --- a/kernel/cgroup.c +++ b/kernel

[PATCH 4/7] cgroup: rename cgroup_pidlist-mutex

2013-07-31 Thread Li Zefan
It's a semaphore not a mutex. Signed-off-by: Li Zefan lize...@huawei.com --- kernel/cgroup.c | 22 +++--- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/kernel/cgroup.c b/kernel/cgroup.c index f0d7f5d..0d378b1 100644 --- a/kernel/cgroup.c +++ b/kernel/cgroup.c

[PATCH 3/7] cgroup: restructure the failure path in cgroup_write_event_control()

2013-07-31 Thread Li Zefan
It uses a single label and checks the validity of each pointer. This is err-prone, and actually we once had a bug because one of the check was insufficient. Use multi lables as we do in other places. Signed-off-by: Li Zefan lize...@huawei.com --- kernel/cgroup.c | 33

[PATCH 0/7] some pending cgroup patches

2013-07-31 Thread Li Zefan
The first one is a small bug fix, and the rest are pure cleanups. Li Zefan (7): cgroup: fix a leak when percpu_ref_init() fails cgroup: remove sparse tags from offline_css() cgroup: restructure the failure path in cgroup_write_event_control() cgroup: rename cgroup_pidlist

[PATCH 6/7] cgroup: rename current_css_set_cg_links

2013-07-31 Thread Li Zefan
to change the interface. Signed-off-by: Li Zefan lize...@huawei.com --- kernel/cgroup.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/kernel/cgroup.c b/kernel/cgroup.c index ac77d87..89d63b0 100644 --- a/kernel/cgroup.c +++ b/kernel/cgroup.c @@ -5312,9 +5312,9

[PATCH 5/7] cgroup: remove struct cgroup_seqfile_state

2013-07-31 Thread Li Zefan
We can use struct struct cfent instead. Signed-off-by: Li Zefan lize...@huawei.com --- kernel/cgroup.c | 38 -- 1 file changed, 12 insertions(+), 26 deletions(-) diff --git a/kernel/cgroup.c b/kernel/cgroup.c index 0d378b1..ac77d87 100644 --- a/kernel

[PATCH 7/7] cgroup: more naming cleanups

2013-07-31 Thread Li Zefan
Constantly use @cset for css_set varabbles and use @cgrp as cgroup variables. Signed-off-by: Li Zefan lize...@huawei.com --- include/linux/cgroup.h | 6 +++--- kernel/cgroup.c| 26 +- kernel/cpuset.c| 16 3 files changed, 24 insertions

Re: [PATCH 5/7] cgroup: remove struct cgroup_seqfile_state

2013-07-31 Thread Li Zefan
static int cgroup_seqfile_release(struct inode *inode, struct file *file) { - struct seq_file *seq = file-private_data; - kfree(seq-private); return single_release(inode, file); } Oh, I just realized now we can remove cgroup_seqfile_release(). Will send out an updated

[PATCH v2 5/5] cgroup: remove struct cgroup_seqfile_state

2013-07-31 Thread Li Zefan
We can use struct cfent instead. v2: - remove cgroup_seqfile_release(). Signed-off-by: Li Zefan lize...@huawei.com --- kernel/cgroup.c | 45 + 1 file changed, 13 insertions(+), 32 deletions(-) diff --git a/kernel/cgroup.c b/kernel/cgroup.c index

Re: [PATCH v2 5/5] cgroup: remove struct cgroup_seqfile_state

2013-07-31 Thread Li Zefan
On 2013/7/31 19:36, Tejun Heo wrote: On Wed, Jul 31, 2013 at 05:36:25PM +0800, Li Zefan wrote: We can use struct cfent instead. v2: - remove cgroup_seqfile_release(). Signed-off-by: Li Zefan lize...@huawei.com Applied to libata/for-3.12. libata? I hope you didn't

Re: [PATCH 6/7] cgroup: rename current_css_set_cg_links

2013-07-31 Thread Li Zefan
On 2013/7/31 19:38, Tejun Heo wrote: Hello, On Wed, Jul 31, 2013 at 04:18:07PM +0800, Li Zefan wrote: As we've renamed css_set-cg_links to css_set-cgrp_links (See commit 69d0206c79 cgroup: bring some sanity to naming around cg_cgroup_link), it's better to also rename the debug file

Re: [PATCH 5/7] cgroup: remove struct cgroup_seqfile_state

2013-07-31 Thread Li Zefan
On 2013/7/31 19:35, Tejun Heo wrote: On Wed, Jul 31, 2013 at 05:27:39PM +0800, Li Zefan wrote: static int cgroup_seqfile_release(struct inode *inode, struct file *file) { - struct seq_file *seq = file-private_data; - kfree(seq-private); return single_release(inode, file); } Oh

[PATCH v2 4/7] cgroup: rename cgroup_pidlist-mutex

2013-07-31 Thread Li Zefan
It's a rw_semaphore not a mutex. Signed-off-by: Li Zefan lize...@huawei.com --- kernel/cgroup.c | 22 +++--- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/kernel/cgroup.c b/kernel/cgroup.c index ae905a5..6662811 100644 --- a/kernel/cgroup.c +++ b/kernel/cgroup.c

[PATCH v2 3/7] cgroup: restructure the failure path in cgroup_write_event_control()

2013-07-31 Thread Li Zefan
It uses a single label and checks the validity of each pointer. This is err-prone, and actually we had a bug because one of the check was insufficient. Use multi lables as we do in other places. v2: - drop initializations of local variables. Signed-off-by: Li Zefan lize...@huawei.com

[PATCH v4 5/8] memcg: convert to use cgroup id

2013-07-30 Thread Li Zefan
Use cgroup id instead of css id. This is a preparation to kill css id. Note, as memcg treat 0 as an invalid id, while cgroup id starts with 0, we define memcg_id == cgroup_id + 1. Signed-off-by: Li Zefan Acked-by: Michal Hocko --- mm/memcontrol.c | 34 -- 1

[PATCH v4 8/8] cgroup: kill css_id

2013-07-30 Thread Li Zefan
The only user of css_id was memcg, and it has been convered to use cgroup->id, so kill css_id. Signed-off-by: Li Zefan Reviewed-by: Michal Hocko --- include/linux/cgroup.h | 37 kernel/cgroup.c| 252 + 2 files changed

[PATCH v4 3/8] cgroup: implement cgroup_from_id()

2013-07-30 Thread Li Zefan
This will be used as a replacement for css_lookup(). There's a difference with cgroup id and css id. cgroup id starts with 0, while css id starts with 1. v4: - also check if cggroup_mutex is held. - make it an inline function. Signed-off-by: Li Zefan Reviewed-by: Michal Hocko --- include

[PATCH v4 6/8] memcg: fail to create cgroup if the cgroup id is too big

2013-07-30 Thread Li Zefan
memcg requires the cgroup id to be smaller than 65536. This is a preparation to kill css id. Signed-off-by: Li Zefan Acked-by: Michal Hocko --- mm/memcontrol.c | 9 + 1 file changed, 9 insertions(+) diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 62541f5..ad7d7c9 100644 --- a/mm

[PATCH v4 7/8] memcg: stop using css id

2013-07-30 Thread Li Zefan
Now memcg uses cgroup id instead of css id. Update some comments and set mem_cgroup_subsys->use_id to 0. Signed-off-by: Li Zefan Acked-by: Michal Hocko --- mm/memcontrol.c | 23 --- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/mm/memcontrol.c b

[PATCH v4 2/8] cgroup: document how cgroup IDs are assigned

2013-07-30 Thread Li Zefan
As cgroup id has been used in netprio cgroup and will be used in memcg, it's important to make it clear how a cgroup id is allocated. For example, in netprio cgroup, the id is used as index of anarray. Signed-off-by: Li Zefan Reviewed-by: Michal Hocko --- include/linux/cgroup.h | 8

[PATCH v4 4/8] memcg: convert to use cgroup_is_descendant()

2013-07-30 Thread Li Zefan
This is a preparation to kill css_id. Signed-off-by: Li Zefan Acked-by: Michal Hocko --- mm/memcontrol.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/memcontrol.c b/mm/memcontrol.c index d12ca6f..626c426 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -1434,7

[PATCH v4 1/8] cgroup: convert cgroup_ida to cgroup_idr

2013-07-30 Thread Li Zefan
-by: Li Zefan Reviewed-by: Michal Hocko --- include/linux/cgroup.h | 4 ++-- kernel/cgroup.c| 33 +++-- 2 files changed, 29 insertions(+), 8 deletions(-) diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h index 297462b..2bd052d 100644 --- a/include/linux

[PATCH v4 0/8] memcg, cgroup: kill css_id

2013-07-30 Thread Li Zefan
_mutex is held. - add a comment for idr_remove() in cgroup_offline)fn(). v2->v3: - some minor cleanups suggested by Michal. - fixed the call to idr_alloc() in cgroup_init() in the first patch. Li Zefan (8): cgroup: convert cgroup_ida to cgroup_idr cgroup: document how cgroup IDs are

Re: call_usermodehelper() returns -513 when ocfs2 umounting filesystems

2013-07-30 Thread Li Zefan
On 2013/7/30 16:51, Xue jiufei wrote: > On 2013/7/30 15:30, Xue jiufei wrote: >> Hi, >> We have encountered an error when umounting ocfs2 filesystems. >> Function ocfs2_leave_group() calls call_usermodehelper() to stop >> heartbeat thread, but it returns -513(ERESTARTNOINTR) in one test. >> And

Re: call_usermodehelper() returns -513 when ocfs2 umounting filesystems

2013-07-30 Thread Li Zefan
On 2013/7/30 16:51, Xue jiufei wrote: On 2013/7/30 15:30, Xue jiufei wrote: Hi, We have encountered an error when umounting ocfs2 filesystems. Function ocfs2_leave_group() calls call_usermodehelper() to stop heartbeat thread, but it returns -513(ERESTARTNOINTR) in one test. And after that

[PATCH v4 1/8] cgroup: convert cgroup_ida to cgroup_idr

2013-07-30 Thread Li Zefan
-by: Li Zefan lize...@huawei.com Reviewed-by: Michal Hocko mho...@suse.cz --- include/linux/cgroup.h | 4 ++-- kernel/cgroup.c| 33 +++-- 2 files changed, 29 insertions(+), 8 deletions(-) diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h index 297462b

[PATCH v4 0/8] memcg, cgroup: kill css_id

2013-07-30 Thread Li Zefan
is held. - add a comment for idr_remove() in cgroup_offline)fn(). v2-v3: - some minor cleanups suggested by Michal. - fixed the call to idr_alloc() in cgroup_init() in the first patch. Li Zefan (8): cgroup: convert cgroup_ida to cgroup_idr cgroup: document how cgroup IDs are assigned

[PATCH v4 4/8] memcg: convert to use cgroup_is_descendant()

2013-07-30 Thread Li Zefan
This is a preparation to kill css_id. Signed-off-by: Li Zefan lize...@huawei.com Acked-by: Michal Hocko mho...@suse.cz --- mm/memcontrol.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/memcontrol.c b/mm/memcontrol.c index d12ca6f..626c426 100644 --- a/mm/memcontrol.c

[PATCH v4 2/8] cgroup: document how cgroup IDs are assigned

2013-07-30 Thread Li Zefan
As cgroup id has been used in netprio cgroup and will be used in memcg, it's important to make it clear how a cgroup id is allocated. For example, in netprio cgroup, the id is used as index of anarray. Signed-off-by: Li Zefan lize...@huwei.com Reviewed-by: Michal Hocko mho...@suse.cz

[PATCH v4 6/8] memcg: fail to create cgroup if the cgroup id is too big

2013-07-30 Thread Li Zefan
memcg requires the cgroup id to be smaller than 65536. This is a preparation to kill css id. Signed-off-by: Li Zefan lize...@huawei.com Acked-by: Michal Hocko mho...@suse.cz --- mm/memcontrol.c | 9 + 1 file changed, 9 insertions(+) diff --git a/mm/memcontrol.c b/mm/memcontrol.c index

[PATCH v4 7/8] memcg: stop using css id

2013-07-30 Thread Li Zefan
Now memcg uses cgroup id instead of css id. Update some comments and set mem_cgroup_subsys-use_id to 0. Signed-off-by: Li Zefan lize...@huawei.com Acked-by: Michal Hocko mho...@suse.cz --- mm/memcontrol.c | 23 --- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git

[PATCH v4 3/8] cgroup: implement cgroup_from_id()

2013-07-30 Thread Li Zefan
This will be used as a replacement for css_lookup(). There's a difference with cgroup id and css id. cgroup id starts with 0, while css id starts with 1. v4: - also check if cggroup_mutex is held. - make it an inline function. Signed-off-by: Li Zefan lize...@huawei.com Reviewed-by: Michal Hocko

[PATCH v4 8/8] cgroup: kill css_id

2013-07-30 Thread Li Zefan
The only user of css_id was memcg, and it has been convered to use cgroup-id, so kill css_id. Signed-off-by: Li Zefan lize...@huwei.com Reviewed-by: Michal Hocko mho...@suse.cz --- include/linux/cgroup.h | 37 kernel/cgroup.c| 252

[PATCH v4 5/8] memcg: convert to use cgroup id

2013-07-30 Thread Li Zefan
Use cgroup id instead of css id. This is a preparation to kill css id. Note, as memcg treat 0 as an invalid id, while cgroup id starts with 0, we define memcg_id == cgroup_id + 1. Signed-off-by: Li Zefan lize...@huawei.com Acked-by: Michal Hocko mho...@suse.cz --- mm/memcontrol.c | 34

Re: Checkpatch error on trace events macros

2013-07-29 Thread Li Zefan
On 2013/7/30 11:10, Joe Perches wrote: > On Tue, 2013-07-30 at 11:04 +0800, Li Zefan wrote: >> On 2013/7/30 10:36, Joe Perches wrote: >>> On Tue, 2013-07-30 at 10:06 +0800, Li Zefan wrote: >>>> On 2013/7/30 9:58, Joe Perches wrote: >>>>> So what are t

Re: Checkpatch error on trace events macros

2013-07-29 Thread Li Zefan
On 2013/7/30 10:36, Joe Perches wrote: > On Tue, 2013-07-30 at 10:06 +0800, Li Zefan wrote: >> On 2013/7/30 9:58, Joe Perches wrote: >>> So what are these TRACE_ defines that need >>> excluding from the "complex values" check? >>>

Re: Checkpatch error on trace events macros

2013-07-29 Thread Li Zefan
On 2013/7/30 9:58, Joe Perches wrote: > On Tue, 2013-07-30 at 09:30 +0800, Li Zefan wrote: >> On 2013/7/30 3:52, Sarah Sharp wrote: >>> Hi Andy and Joe, >>> >>> Checkpatch is complaining when code adds new trace events macros: >>> >>> sarah@xan

Re: memcg creates an unkillable task in 3.2-rc2

2013-07-29 Thread Li Zefan
> I am also seeing what looks like a leak somewhere in the cgroup code as > well. After some runs of the same reproducer I get into a state where > after everything is clean up. All of the control groups have been > removed and the cgroup filesystem is unmounted, I can mount a cgroup >

Re: Checkpatch error on trace events macros

2013-07-29 Thread Li Zefan
On 2013/7/30 3:52, Sarah Sharp wrote: > Hi Andy and Joe, > > Checkpatch is complaining when code adds new trace events macros: > > sarah@xanatos:~/git/kernels/xhci$ git am -s ~/Maildir.fetchmail/.to-apply > Applying: xhci: add traces for debug messages in xhci_address_device() > ERROR: Macros

Re: [PATCH v3 1/8] cgroup: convert cgroup_ida to cgroup_idr

2013-07-29 Thread Li Zefan
On 2013/7/30 2:28, Tejun Heo wrote: > Hello, > > On Mon, Jul 29, 2013 at 03:07:48PM +0800, Li Zefan wrote: >> @@ -4590,6 +4599,9 @@ static void cgroup_offline_fn(struct work_struct *work) >> /* delete this cgroup from parent->children */ >> list_del_rcu(&g

Re: [PATCH v3 2/8] cgroup: document how cgroup IDs are assigned

2013-07-29 Thread Li Zefan
On 2013/7/30 2:26, Tejun Heo wrote: > On Mon, Jul 29, 2013 at 03:08:04PM +0800, Li Zefan wrote: >> As cgroup id has been used in netprio cgroup and will be used in memcg, >> it's important to make it clear how a cgroup id is allocated. >> >> For example, in netprio cgro

[PATCH v3 8/8] cgroup: kill css_id

2013-07-29 Thread Li Zefan
The only user of css_id was memcg, and it has been convered to use cgroup->id, so kill css_id. Signed-off-by: Li Zefan Reviewed-by: Michal Hocko --- include/linux/cgroup.h | 37 kernel/cgroup.c| 252 + 2 files changed

[PATCH v3 2/8] cgroup: document how cgroup IDs are assigned

2013-07-29 Thread Li Zefan
As cgroup id has been used in netprio cgroup and will be used in memcg, it's important to make it clear how a cgroup id is allocated. For example, in netprio cgroup, the id is used as index of anarray. Signed-off-by: Li Zefan Reviewed-by: Michal Hocko --- include/linux/cgroup.h | 8

[PATCH v3 6/8] memcg: fail to create cgroup if the cgroup id is too big

2013-07-29 Thread Li Zefan
memcg requires the cgroup id to be smaller than 65536. This is a preparation to kill css id. Signed-off-by: Li Zefan Acked-by: Michal Hocko --- mm/memcontrol.c | 9 + 1 file changed, 9 insertions(+) diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 62541f5..ad7d7c9 100644 --- a/mm

<    2   3   4   5   6   7   8   9   10   11   >