Re: [cgroup/task_lock] INFO: suspicious RCU usage.

2014-02-25 Thread Li Zefan
On 2014/2/21 23:40, Tejun Heo wrote: > Hello, > > On Fri, Feb 21, 2014 at 10:16:22AM +0800, Fengguang Wu wrote: >> commit fb47fea7a59cf3d6387c566084a6684b5005af83 >> Author: Tejun Heo >> AuthorDate: Thu Feb 13 15:16:35 2014 -0500 >> Commit: Tejun Heo >> CommitDate: Thu Feb 13 15:16:35

Re: [cgroup/task_lock] INFO: suspicious RCU usage.

2014-02-25 Thread Li Zefan
On 2014/2/21 23:40, Tejun Heo wrote: Hello, On Fri, Feb 21, 2014 at 10:16:22AM +0800, Fengguang Wu wrote: commit fb47fea7a59cf3d6387c566084a6684b5005af83 Author: Tejun Heo t...@kernel.org AuthorDate: Thu Feb 13 15:16:35 2014 -0500 Commit: Tejun Heo t...@kernel.org CommitDate: Thu

Re: [PATCHSET v2 cgroup/for-3.15] cgroup: update task migration path

2014-02-25 Thread Li Zefan
-a-newly-forked-task-gets-associate.patch 0006-cgroup-drop-task_lock-protection-around-task-cgroups.patch 0007-cgroup-update-cgroup_transfer_tasks-to-either-succee.patch Acked-by: Li Zefan lize...@huawei.com -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body

[PATCH v3] sysfs: fix namespace refcnt leak

2014-02-25 Thread Li Zefan
, suggested by Tejun. v3: - Make the new argument as second-to-last arg, suggested by Tejun. Reviewed-by: Tejun Heo t...@kernel.org Signed-off-by: Li Zefan lize...@huawei.com --- fs/kernfs/mount.c | 8 +++- fs/sysfs/mount.c | 5 +++-- include/linux/kernfs.h | 9 + 3 files

Re: [cgroup/task_lock] INFO: suspicious RCU usage.

2014-02-25 Thread Li Zefan
[main] Setsockopt(1 2b 80d1000 4) on fd 223 [17:2:768] [ 27.030764] [ 27.031119] === [ 27.031833] [ INFO: suspicious RCU usage. ] [ 27.032536] 3.14.0-rc3-02458-g837caba #2 Not tainted [ 27.033378] --- [ 27.044237]

Re: [PATCH v3] sysfs: fix namespace refcnt leak

2014-02-25 Thread Li Zefan
On 2014/2/25 23:17, Tejun Heo wrote: On Tue, Feb 25, 2014 at 07:19:55AM -0800, Greg Kroah-Hartman wrote: On Tue, Feb 25, 2014 at 09:42:56AM -0500, Tejun Heo wrote: On Tue, Feb 25, 2014 at 07:28:44PM +0800, Li Zefan wrote: As mount() and kill_sb() is not a one-to-one match, we shoudn't get ns

[tip:sched/core] sched/rt: Remove 'leaf_rt_rq_list' from ' struct rq'

2014-02-22 Thread tip-bot for Li Zefan
Commit-ID: d82fd25356b902703152c1800845661835541878 Gitweb: http://git.kernel.org/tip/d82fd25356b902703152c1800845661835541878 Author: Li Zefan AuthorDate: Sat, 8 Feb 2014 14:17:26 +0800 Committer: Ingo Molnar CommitDate: Sat, 22 Feb 2014 18:10:43 +0100 sched/rt: Remove

[tip:sched/core] sched/rt: Make init_sched_rt_calss() __init

2014-02-22 Thread tip-bot for Li Zefan
Commit-ID: 11c785b79ef2a669e4bf7be5cf2c3904b8fed015 Gitweb: http://git.kernel.org/tip/11c785b79ef2a669e4bf7be5cf2c3904b8fed015 Author: Li Zefan AuthorDate: Sat, 8 Feb 2014 14:17:45 +0800 Committer: Ingo Molnar CommitDate: Sat, 22 Feb 2014 18:11:10 +0100 sched/rt: Make

[tip:sched/core] sched/rt: Remove 'leaf_rt_rq_list' from ' struct rq'

2014-02-22 Thread tip-bot for Li Zefan
Commit-ID: d82fd25356b902703152c1800845661835541878 Gitweb: http://git.kernel.org/tip/d82fd25356b902703152c1800845661835541878 Author: Li Zefan lize...@huawei.com AuthorDate: Sat, 8 Feb 2014 14:17:26 +0800 Committer: Ingo Molnar mi...@kernel.org CommitDate: Sat, 22 Feb 2014 18:10:43

[tip:sched/core] sched/rt: Make init_sched_rt_calss() __init

2014-02-22 Thread tip-bot for Li Zefan
Commit-ID: 11c785b79ef2a669e4bf7be5cf2c3904b8fed015 Gitweb: http://git.kernel.org/tip/11c785b79ef2a669e4bf7be5cf2c3904b8fed015 Author: Li Zefan lize...@huawei.com AuthorDate: Sat, 8 Feb 2014 14:17:45 +0800 Committer: Ingo Molnar mi...@kernel.org CommitDate: Sat, 22 Feb 2014 18:11:10

[tip:sched/core] sched/rt: Remove leaf_rt_rq_list from struct rq

2014-02-21 Thread tip-bot for Li Zefan
Commit-ID: 673ca1919f2b0b83a377395454d5edd12f946bbf Gitweb: http://git.kernel.org/tip/673ca1919f2b0b83a377395454d5edd12f946bbf Author: Li Zefan AuthorDate: Sat, 8 Feb 2014 14:17:26 +0800 Committer: Thomas Gleixner CommitDate: Fri, 21 Feb 2014 21:43:19 +0100 sched/rt: Remove

[tip:sched/core] sched/rt: Make init_sched_rt_calss() __init

2014-02-21 Thread tip-bot for Li Zefan
Commit-ID: 6bd5d275ea039721f6fd382a15dc6adc949c77ec Gitweb: http://git.kernel.org/tip/6bd5d275ea039721f6fd382a15dc6adc949c77ec Author: Li Zefan AuthorDate: Sat, 8 Feb 2014 14:17:45 +0800 Committer: Thomas Gleixner CommitDate: Fri, 21 Feb 2014 21:43:19 +0100 sched/rt: Make

[tip:sched/core] sched/rt: Make init_sched_rt_calss() __init

2014-02-21 Thread tip-bot for Li Zefan
Commit-ID: 6bd5d275ea039721f6fd382a15dc6adc949c77ec Gitweb: http://git.kernel.org/tip/6bd5d275ea039721f6fd382a15dc6adc949c77ec Author: Li Zefan lize...@huawei.com AuthorDate: Sat, 8 Feb 2014 14:17:45 +0800 Committer: Thomas Gleixner t...@linutronix.de CommitDate: Fri, 21 Feb 2014 21:43

[tip:sched/core] sched/rt: Remove leaf_rt_rq_list from struct rq

2014-02-21 Thread tip-bot for Li Zefan
Commit-ID: 673ca1919f2b0b83a377395454d5edd12f946bbf Gitweb: http://git.kernel.org/tip/673ca1919f2b0b83a377395454d5edd12f946bbf Author: Li Zefan lize...@huawei.com AuthorDate: Sat, 8 Feb 2014 14:17:26 +0800 Committer: Thomas Gleixner t...@linutronix.de CommitDate: Fri, 21 Feb 2014 21:43

[PATCH v2] sysfs: fix namespace refcnt leak

2014-02-20 Thread Li Zefan
, suggested by Tejun. Signed-off-by: Li Zefan --- This fix is for 3.14. --- fs/kernfs/mount.c | 8 +++- fs/sysfs/mount.c | 5 +++-- include/linux/kernfs.h | 9 + 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/fs/kernfs/mount.c b/fs/kernfs/mount.c index

[PATCH v2] sysfs: fix namespace refcnt leak

2014-02-20 Thread Li Zefan
, suggested by Tejun. Signed-off-by: Li Zefan lize...@huawei.com --- This fix is for 3.14. --- fs/kernfs/mount.c | 8 +++- fs/sysfs/mount.c | 5 +++-- include/linux/kernfs.h | 9 + 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/fs/kernfs/mount.c b/fs/kernfs

Re: [cgroup] BUG: unable to handle kernel NULL pointer dereference at 0000001c

2014-02-19 Thread Li Zefan
e: Tue Feb 11 11:52:47 2014 -0500 > Commit: Tejun Heo > CommitDate: Tue Feb 11 11:52:47 2014 -0500 > > cgroup: introduce cgroup_tree_mutex > > Signed-off-by: Tejun Heo > Acked-by: Li Zefan > Thanks for the report. It was introduced by e61734c55c2

Re: [cgroup] BUG: unable to handle kernel NULL pointer dereference at 0000001c

2014-02-19 Thread Li Zefan
:47 2014 -0500 Commit: Tejun Heo t...@kernel.org CommitDate: Tue Feb 11 11:52:47 2014 -0500 cgroup: introduce cgroup_tree_mutex Signed-off-by: Tejun Heo t...@kernel.org Acked-by: Li Zefan lize...@huawei.com Thanks for the report. It was introduced

Re: [PATCH] sysfs: fix namespace refcnt leak

2014-02-18 Thread Li Zefan
On 2014/2/19 7:12, Tejun Heo wrote: > Hey, > > On Mon, Feb 17, 2014 at 11:54:59AM +0800, Li Zefan wrote: >> I think we have to fix kernfs in order to fix refcnt leak in sysfs >> and cgroupfs. This fix is for 3.14, but it creates conflic

Re: [PATCH] sysfs: fix namespace refcnt leak

2014-02-18 Thread Li Zefan
On 2014/2/19 7:12, Tejun Heo wrote: Hey, On Mon, Feb 17, 2014 at 11:54:59AM +0800, Li Zefan wrote: I think we have to fix kernfs in order to fix refcnt leak in sysfs and cgroupfs. This fix is for 3.14, but it creates conflicts for cgroup-next. As mount() and kill_sb

[PATCH] sysfs: fix namespace refcnt leak

2014-02-16 Thread Li Zefan
(), and instead we should get the refcnt only when kernfs_mount() allocated a new superblock. Signed-off-by: Li Zefan --- fs/kernfs/mount.c | 7 ++- fs/sysfs/mount.c | 5 +++-- include/linux/kernfs.h | 9 + 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/fs/kernfs

[PATCH] cgroup: add a validation check to cgroup_add_cftyps()

2014-02-16 Thread Li Zefan
ess NULL pointer. The bug was introduced by commit de00ffa56ea3132c6013fc8f07133b8a1014cf53 ("cgroup: make cgroup_subsys->base_cftypes use cgroup_add_cftypes()"). Reported-by: Fengguang Wu Signed-off-by: Li Zefan --- kernel/cgroup.c | 3 +++ 1 file changed, 3 insertions(+) diff --g

[PATCH] cgroup: add a validation check to cgroup_add_cftyps()

2014-02-16 Thread Li Zefan
].ss is NULL, we'll access NULL pointer. The bug was introduced by commit de00ffa56ea3132c6013fc8f07133b8a1014cf53 (cgroup: make cgroup_subsys-base_cftypes use cgroup_add_cftypes()). Reported-by: Fengguang Wu fengguang...@intel.com Signed-off-by: Li Zefan lize...@huawei.com --- kernel/cgroup.c

[PATCH] sysfs: fix namespace refcnt leak

2014-02-16 Thread Li Zefan
(), and instead we should get the refcnt only when kernfs_mount() allocated a new superblock. Signed-off-by: Li Zefan lize...@huawei.com --- fs/kernfs/mount.c | 7 ++- fs/sysfs/mount.c | 5 +++-- include/linux/kernfs.h | 9 + 3 files changed, 14 insertions(+), 7 deletions(-) diff

Re: [cgroups] BUG: unable to handle kernel NULL pointer dereference at 0000003c

2014-02-15 Thread Li Zefan
g cgroup_add_cftypes(). This is done > as a separate step in cgroup_init() instead of a part of > cgroup_init_subsys(). This is because cgroup_init_subsys() can be > called very early during boot when kmalloc() isn't available yet. > > Signed-off-by: Tejun Heo

Re: [PATCH v2] cgroup: fix top cgroup refcnt leak

2014-02-15 Thread Li Zefan
On 2014/2/15 12:03, Li Zefan wrote: > If we mount the same cgroupfs in serveral mount points, and then > umount all of them, kill_sb() will be called only once. > > Therefore it's wrong to increment top_cgroup's refcnt when we find > an existing cgroup_root. > > Try: >

Re: [PATCH v2] cgroup: fix top cgroup refcnt leak

2014-02-15 Thread Li Zefan
On 2014/2/15 12:03, Li Zefan wrote: If we mount the same cgroupfs in serveral mount points, and then umount all of them, kill_sb() will be called only once. Therefore it's wrong to increment top_cgroup's refcnt when we find an existing cgroup_root. Try: # mount -t cgroup -o

Re: [cgroups] BUG: unable to handle kernel NULL pointer dereference at 0000003c

2014-02-15 Thread Li Zefan
of a part of cgroup_init_subsys(). This is because cgroup_init_subsys() can be called very early during boot when kmalloc() isn't available yet. Signed-off-by: Tejun Heo t...@kernel.org Acked-by: Li Zefan lize...@huawei.com [0.02] Calibrating delay loop (skipped

[PATCH v2] cgroup: fix top cgroup refcnt leak

2014-02-14 Thread Li Zefan
and drop it after kernfs_mount(). Signed-off-by: Li Zefan --- kernel/cgroup.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/kernel/cgroup.c b/kernel/cgroup.c index 37d94a2..eaffc08 100644 --- a/kernel/cgroup.c +++ b/kernel/cgroup.c @@ -1477,6 +1477,7 @@ static struct

Re: [PATCH cgroup/for-3.14-fixes] cgroup: update cgroup_enable_task_cg_lists() to grab siglock

2014-02-14 Thread Li Zefan
g boot. I'm wondering whether the better > approach would be just adding "cgroup_disable=all" handling which > disables the whole cgroup rather than tempting fate with this > on-demand craziness. > > Signed-off-by: Tejun Heo > Cc: sta...@vger.kernel.org Acked-by:

Re: [PATCH v2 cgroup/for-3.15] cgroup: make cgroup_enable_task_cg_lists() to grab siglock

2014-02-14 Thread Li Zefan
On 2014/2/15 4:47, Tejun Heo wrote: > Currently, there's nothing explicitly preventing > cgroup_enable_task_cg_lists() from missing set PF_EXITING and race > against cgroup_exit(), and, depending on the timing, cgroup_exit() > seemingly may finish with the task still linked on css_set leading to >

Re: [PATCH] cgroup: fix top cgroup refcnt leak

2014-02-14 Thread Li Zefan
于 2014年02月14日 17:36, Li Zefan 写道: > If we mount the same cgroupfs in serveral mount points, and then > umount all of them, kill_sb() will be called only once. > > Therefore it's wrong to increment top_cgroup's refcnt when we find > an existing cgroup_root. > > Try: >

[PATCH] cgroup: fix top cgroup refcnt leak

2014-02-14 Thread Li Zefan
upwards. Signed-off-by: Li Zefan --- kernel/cgroup.c | 32 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/kernel/cgroup.c b/kernel/cgroup.c index 37d94a2..5bfe738 100644 --- a/kernel/cgroup.c +++ b/kernel/cgroup.c @@ -1498,6 +1498,22 @@ retry

[PATCH] kernfs: fix kernfs_node_from_dentry()

2014-02-14 Thread Li Zefan
-22 With this fix: # Documentation/accounting/getdelays -C /cgroup sleeping 305, blocked 0, running 1, stopped 0, uninterruptible 1 Signed-off-by: Li Zefan --- fs/kernfs/dir.c | 2 +- fs/kernfs/kernfs-internal.h | 1 + fs/kernfs/mount.c | 2 +- 3 files changed, 3 inserti

[PATCH 3/3] cgroup: deal with dummp_top in cgroup_name() and cgroup_path()

2014-02-14 Thread Li Zefan
My kernel fails to boot, because blkcg calls cgroup_path() while cgroupfs is not mounted. Fix both cgroup_name() and cgroup_path(). Signed-off-by: Li Zefan --- include/linux/cgroup.h | 12 ++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/include/linux/cgroup.h b

[PATCH 1/3] cgroup: fix locking in cgroupstats_build()

2014-02-14 Thread Li Zefan
css_set_lock has been converted to css_set_rwsem, and rwsem can't nested inside rcu_read_lock. Signed-off-by: Li Zefan --- kernel/cgroup.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/kernel/cgroup.c b/kernel/cgroup.c index af4ecc3..0e794ca 100644 --- a/kernel

[PATCH 2/3] cgroup: fix memory leak in cgroup_mount()

2014-02-14 Thread Li Zefan
We should free the memory allocated in parse_cgroupfs_options() before calling this function again. Signed-off-by: Li Zefan --- kernel/cgroup.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kernel/cgroup.c b/kernel/cgroup.c index 0e794ca..37d94a2 100644 --- a/kernel/cgroup.c +++ b

[PATCH 2/3] cgroup: fix memory leak in cgroup_mount()

2014-02-14 Thread Li Zefan
We should free the memory allocated in parse_cgroupfs_options() before calling this function again. Signed-off-by: Li Zefan lize...@huawei.com --- kernel/cgroup.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kernel/cgroup.c b/kernel/cgroup.c index 0e794ca..37d94a2 100644 --- a/kernel

[PATCH 1/3] cgroup: fix locking in cgroupstats_build()

2014-02-14 Thread Li Zefan
css_set_lock has been converted to css_set_rwsem, and rwsem can't nested inside rcu_read_lock. Signed-off-by: Li Zefan lize...@huawei.com --- kernel/cgroup.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/kernel/cgroup.c b/kernel/cgroup.c index af4ecc3..0e794ca

[PATCH 3/3] cgroup: deal with dummp_top in cgroup_name() and cgroup_path()

2014-02-14 Thread Li Zefan
My kernel fails to boot, because blkcg calls cgroup_path() while cgroupfs is not mounted. Fix both cgroup_name() and cgroup_path(). Signed-off-by: Li Zefan lize...@huawei.com --- include/linux/cgroup.h | 12 ++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/include

[PATCH] kernfs: fix kernfs_node_from_dentry()

2014-02-14 Thread Li Zefan
With this fix: # Documentation/accounting/getdelays -C /cgroup sleeping 305, blocked 0, running 1, stopped 0, uninterruptible 1 Signed-off-by: Li Zefan lize...@huawei.com --- fs/kernfs/dir.c | 2 +- fs/kernfs/kernfs-internal.h | 1 + fs/kernfs/mount.c | 2 +- 3 files changed

[PATCH] cgroup: fix top cgroup refcnt leak

2014-02-14 Thread Li Zefan
upwards. Signed-off-by: Li Zefan lize...@huawei.com --- kernel/cgroup.c | 32 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/kernel/cgroup.c b/kernel/cgroup.c index 37d94a2..5bfe738 100644 --- a/kernel/cgroup.c +++ b/kernel/cgroup.c @@ -1498,6

Re: [PATCH] cgroup: fix top cgroup refcnt leak

2014-02-14 Thread Li Zefan
于 2014年02月14日 17:36, Li Zefan 写道: If we mount the same cgroupfs in serveral mount points, and then umount all of them, kill_sb() will be called only once. Therefore it's wrong to increment top_cgroup's refcnt when we find an existing cgroup_root. Try: # mount -t cgroup -o cpuacct

Re: [PATCH v2 cgroup/for-3.15] cgroup: make cgroup_enable_task_cg_lists() to grab siglock

2014-02-14 Thread Li Zefan
On 2014/2/15 4:47, Tejun Heo wrote: Currently, there's nothing explicitly preventing cgroup_enable_task_cg_lists() from missing set PF_EXITING and race against cgroup_exit(), and, depending on the timing, cgroup_exit() seemingly may finish with the task still linked on css_set leading to list

Re: [PATCH cgroup/for-3.14-fixes] cgroup: update cgroup_enable_task_cg_lists() to grab siglock

2014-02-14 Thread Li Zefan
approach would be just adding cgroup_disable=all handling which disables the whole cgroup rather than tempting fate with this on-demand craziness. Signed-off-by: Tejun Heo t...@kernel.org Cc: sta...@vger.kernel.org Acked-by: Li Zefan lize...@huawei.com -- To unsubscribe from this list: send

[PATCH v2] cgroup: fix top cgroup refcnt leak

2014-02-14 Thread Li Zefan
and drop it after kernfs_mount(). Signed-off-by: Li Zefan lize...@huawei.com --- kernel/cgroup.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/kernel/cgroup.c b/kernel/cgroup.c index 37d94a2..eaffc08 100644 --- a/kernel/cgroup.c +++ b/kernel/cgroup.c @@ -1477,6 +1477,7

Re: [PATCH cgroup/for-3.14-fixes] cgroup: update cgroup_enable_task_cg_lists() to grab siglock

2014-02-13 Thread Li Zefan
boot. I added the PF_EXITING check years ago: commit 0e04388f0189fa1f6812a8e1cb6172136eada87e Author: Li Zefan Date: Thu Apr 17 11:37:15 2008 +0800 cgroup: fix a race condition in manipulating tsk->cg_list Now the only race I see is caused by checking tsk->cg

Re: [PATCH cgroup/for-3.14-fixes] cgroup: update cgroup_enable_task_cg_lists() to grab siglock

2014-02-13 Thread Li Zefan
years ago: commit 0e04388f0189fa1f6812a8e1cb6172136eada87e Author: Li Zefan l...@cn.fujitsu.com Date: Thu Apr 17 11:37:15 2008 +0800 cgroup: fix a race condition in manipulating tsk-cg_list Now the only race I see is caused by checking tsk-cg_list without locking in cgroup_exit

Re: [PATCH 09/16] cgroup: remove css_scan_tasks()

2014-02-12 Thread Li Zefan
On 2014/2/9 21:52, Tejun Heo wrote: > css_scan_tasks() doesn't have any user left. Remove it. > I always dislike css_scan_tasks(). -- 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

Re: [PATCHSET cgroup/for-3.15] cgroup: more cleanups

2014-02-12 Thread Li Zefan
ocking during iteration and removes css_scan_tasks(). > > 0010-0015 clean up migration path to prepare for the planned > migration taskset handling update. > Acked-by: Li Zefan -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a

Re: [PATCH] cgroup: protect modifications to cgroup_idr with cgroup_mutex

2014-02-12 Thread Li Zefan
On 2014/2/12 17:12, Michal Hocko wrote: > Li has pointed out that my previous backport was not correct because > err_unlock label releases a reference to supperblock which was not taken > before idr_alloc. I've also removed cgroup_mutex from free_css_id as per > Li. > Fixed in this version. >

Re: [PATCHSET v2 cgroup/for-3.15] cgroup: cleanups after kernfs conversion

2014-02-12 Thread Li Zefan
-dynamic-cftype-addition-and-removal.patch > 0005-cgroup-make-cgroup-hold-onto-its-kernfs_node.patch > 0006-cgroup-remove-cgroup-name.patch > 0007-cgroup-rename-cgroupfs_root-number_of_cgroups-to-nr_.patch > 0008-cgroup-remove-cgroupfs_root-refcnt.patch > Ack-by: Li Zefan -- To uns

Re: [PATCH 6/8] cgroup: remove cgroup->name

2014-02-12 Thread Li Zefan
On 2014/2/12 16:27, Tejun Heo wrote: > On Wed, Feb 12, 2014 at 03:52:20PM +0800, Li Zefan wrote: >> The caller won't check the return value but pass it to printk/seq_printf, >> but now cgroup_path() might return -ENAMETOOLONG.. > > cgroup_path() returns NULL on overflow whic

Re: [PATCH 6/8] cgroup: remove cgroup-name

2014-02-12 Thread Li Zefan
On 2014/2/12 16:27, Tejun Heo wrote: On Wed, Feb 12, 2014 at 03:52:20PM +0800, Li Zefan wrote: The caller won't check the return value but pass it to printk/seq_printf, but now cgroup_path() might return -ENAMETOOLONG.. cgroup_path() returns NULL on overflow which printk handles fine

Re: [PATCHSET v2 cgroup/for-3.15] cgroup: cleanups after kernfs conversion

2014-02-12 Thread Li Zefan
-cgroup-hold-onto-its-kernfs_node.patch 0006-cgroup-remove-cgroup-name.patch 0007-cgroup-rename-cgroupfs_root-number_of_cgroups-to-nr_.patch 0008-cgroup-remove-cgroupfs_root-refcnt.patch Ack-by: Li Zefan lize...@huawei.com -- To unsubscribe from this list: send the line unsubscribe linux

Re: [PATCH] cgroup: protect modifications to cgroup_idr with cgroup_mutex

2014-02-12 Thread Li Zefan
On 2014/2/12 17:12, Michal Hocko wrote: Li has pointed out that my previous backport was not correct because err_unlock label releases a reference to supperblock which was not taken before idr_alloc. I've also removed cgroup_mutex from free_css_id as per Li. Fixed in this version. Looks

Re: [PATCHSET cgroup/for-3.15] cgroup: more cleanups

2014-02-12 Thread Li Zefan
migration taskset handling update. 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 at http

Re: [PATCH 09/16] cgroup: remove css_scan_tasks()

2014-02-12 Thread Li Zefan
On 2014/2/9 21:52, Tejun Heo wrote: css_scan_tasks() doesn't have any user left. Remove it. I always dislike css_scan_tasks(). -- 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

Re: [PATCH 6/8] cgroup: remove cgroup->name

2014-02-11 Thread Li Zefan
> diff --git a/kernel/sched/debug.c b/kernel/sched/debug.c > index dd52e7f..30eee3b 100644 > --- a/kernel/sched/debug.c > +++ b/kernel/sched/debug.c > @@ -111,8 +111,7 @@ static char *task_group_path(struct task_group *tg) > if (autogroup_path(tg, group_path, PATH_MAX)) >

Re: [PATCH v2] cgroup: protect modifications to cgroup->idr with cgroup_mutex

2014-02-11 Thread Li Zefan
On 2014/2/12 14:37, Tejun Heo wrote: > Hello, Li. > > On Wed, Feb 12, 2014 at 02:28:53PM +0800, Li Zefan wrote: >> v2: >> - Don't call deactivate_super() inside cgroup_mutex, as cgroup_kill_sb() >> will be called if sb refcnt reaches 0. I don't think this can

[PATCH v2] cgroup: protect modifications to cgroup->idr with cgroup_mutex

2014-02-11 Thread Li Zefan
uess is probably correct. Fixes: 4e96ee8e981b ("cgroup: convert cgroup_ida to cgroup_idr") Reported-by: Michal Hocko Signed-off-by: Li Zefan --- Also rebased on "cgroup: fix error return from cgroup_create()". --- include/linux/c

Re: [PATCH cgroup/for-3.14-fixes] cgroup: protect modifications to cgroup_idr with cgroup_mutex

2014-02-11 Thread Li Zefan
On 2014/2/12 10:15, Li Zefan wrote: > On 2014/2/12 0:26, Michal Hocko wrote: >> On Tue 11-02-14 10:41:05, Tejun Heo wrote: >> [...] >>> @@ -4254,12 +4256,12 @@ static long cgroup_create(struct cgroup *parent, >>> struct dentry *dentry, >>>

Re: [PATCH cgroup/for-3.14-fixes] cgroup: protect modifications to cgroup_idr with cgroup_mutex

2014-02-11 Thread Li Zefan
On 2014/2/12 0:26, Michal Hocko wrote: > On Tue 11-02-14 10:41:05, Tejun Heo wrote: > [...] >> @@ -4254,12 +4256,12 @@ static long cgroup_create(struct cgroup *parent, >> struct dentry *dentry, >> >> return 0; >> >> -err_unlock: >> -mutex_unlock(_mutex); >> -/* Release the

Re: [PATCH] cgroup: protect modifications to cgroup_idr with cgroup_mutex

2014-02-11 Thread Li Zefan
On 2014/2/11 18:20, Michal Hocko wrote: > Hi Li, > good work in reproducing the issue so quickly! > I have tried to backport this patch to 3.12 kernel but the code has > changed since then. > The only two instances of idr_remove which are called outside of > cgroup_mutex seem to be: > -

Re: [PATCH 2/3] jffs2: avoid soft-lockup in jffs2_reserve_space_gc()

2014-02-11 Thread Li Zefan
>> --- a/fs/jffs2/nodemgmt.c >> +++ b/fs/jffs2/nodemgmt.c >> @@ -216,15 +216,20 @@ int jffs2_reserve_space_gc(struct jffs2_sb_info *c, >> uint32_t minsize, >> >> jffs2_dbg(1, "%s(): Requested 0x%x bytes\n", __func__, minsize); >> >> -spin_lock(>erase_completion_lock); >> -

Re: [PATCHSET cgroup/for-3.15] cgroup: convert to kernfs

2014-02-11 Thread Li Zefan
/cgroup.c| 1712 > ++++++++- > kernel/events/core.c | 17 > mm/memcontrol.c| 16 > mm/memory-failure.c|8 > 7 files changed, 754 insertions(+), 1077 deletions(-) > Looks good to me! Acked-by: Li Zefan Will look into

[PATCH] cgroup: protect modifications to cgroup_idr with cgroup_mutex

2014-02-11 Thread Li Zefan
{alloc,remove}(). Fixes: 4e96ee8e981b ("cgroup: convert cgroup_ida to cgroup_idr") Cc: #3.12+ Reported-by: Michal Hocko Signed-off-by: Li Zefan --- include/linux/cgroup.h | 2 ++ kernel/cgroup.c| 30 -- 2 files changed, 18 insertions(+), 14 deletions(-) d

[PATCH] cgroup: protect modifications to cgroup_idr with cgroup_mutex

2014-02-11 Thread Li Zefan
...@suse.cz Signed-off-by: Li Zefan lize...@huawei.com --- include/linux/cgroup.h | 2 ++ kernel/cgroup.c| 30 -- 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h index 5c09759..9450f02 100644

Re: [PATCHSET cgroup/for-3.15] cgroup: convert to kernfs

2014-02-11 Thread Li Zefan
| 1712 - kernel/events/core.c | 17 mm/memcontrol.c| 16 mm/memory-failure.c|8 7 files changed, 754 insertions(+), 1077 deletions(-) Looks good to me! Acked-by: Li Zefan lize...@huawei.com Will look into remaining

Re: [PATCH 2/3] jffs2: avoid soft-lockup in jffs2_reserve_space_gc()

2014-02-11 Thread Li Zefan
--- a/fs/jffs2/nodemgmt.c +++ b/fs/jffs2/nodemgmt.c @@ -216,15 +216,20 @@ int jffs2_reserve_space_gc(struct jffs2_sb_info *c, uint32_t minsize, jffs2_dbg(1, %s(): Requested 0x%x bytes\n, __func__, minsize); -spin_lock(c-erase_completion_lock); -while(ret == -EAGAIN) { +

Re: [PATCH] cgroup: protect modifications to cgroup_idr with cgroup_mutex

2014-02-11 Thread Li Zefan
On 2014/2/11 18:20, Michal Hocko wrote: Hi Li, good work in reproducing the issue so quickly! I have tried to backport this patch to 3.12 kernel but the code has changed since then. The only two instances of idr_remove which are called outside of cgroup_mutex seem to be: - cgroup_create

Re: [PATCH cgroup/for-3.14-fixes] cgroup: protect modifications to cgroup_idr with cgroup_mutex

2014-02-11 Thread Li Zefan
On 2014/2/12 0:26, Michal Hocko wrote: On Tue 11-02-14 10:41:05, Tejun Heo wrote: [...] @@ -4254,12 +4256,12 @@ static long cgroup_create(struct cgroup *parent, struct dentry *dentry, return 0; -err_unlock: -mutex_unlock(cgroup_mutex); -/* Release the reference count

Re: [PATCH cgroup/for-3.14-fixes] cgroup: protect modifications to cgroup_idr with cgroup_mutex

2014-02-11 Thread Li Zefan
On 2014/2/12 10:15, Li Zefan wrote: On 2014/2/12 0:26, Michal Hocko wrote: On Tue 11-02-14 10:41:05, Tejun Heo wrote: [...] @@ -4254,12 +4256,12 @@ static long cgroup_create(struct cgroup *parent, struct dentry *dentry, return 0; -err_unlock: - mutex_unlock(cgroup_mutex

[PATCH v2] cgroup: protect modifications to cgroup-idr with cgroup_mutex

2014-02-11 Thread Li Zefan
-off-by: Li Zefan lize...@huawei.com --- Also rebased on cgroup: fix error return from cgroup_create(). --- include/linux/cgroup.h | 2 ++ kernel/cgroup.c| 47 ++- 2 files changed, 28 insertions(+), 21 deletions(-) diff --git a/include/linux

Re: [PATCH v2] cgroup: protect modifications to cgroup-idr with cgroup_mutex

2014-02-11 Thread Li Zefan
On 2014/2/12 14:37, Tejun Heo wrote: Hello, Li. On Wed, Feb 12, 2014 at 02:28:53PM +0800, Li Zefan wrote: v2: - Don't call deactivate_super() inside cgroup_mutex, as cgroup_kill_sb() will be called if sb refcnt reaches 0. I don't think this can happen, as cgroup_create() is called through

Re: [PATCH 6/8] cgroup: remove cgroup-name

2014-02-11 Thread Li Zefan
diff --git a/kernel/sched/debug.c b/kernel/sched/debug.c index dd52e7f..30eee3b 100644 --- a/kernel/sched/debug.c +++ b/kernel/sched/debug.c @@ -111,8 +111,7 @@ static char *task_group_path(struct task_group *tg) if (autogroup_path(tg, group_path, PATH_MAX)) return

[PATCH 1/2] sched/rt: Remove leaf_rt_rq_list from struct rq

2014-02-07 Thread Li Zefan
This is a leftover from commit e23ee74777f389369431d77390c4b09332ce026a ("sched/rt: Simplify pull_rt_task() logic and remove .leaf_rt_rq_list"). Signed-off-by: Li Zefan --- kernel/sched/core.c | 1 - kernel/sched/sched.h | 4 2 files changed, 5 deletions(-) diff --git a/ke

[PATCH 2/2] sched/rt: Make init_sched_rt_calss() __init

2014-02-07 Thread Li Zefan
It's a bootstrap function. Signed-off-by: Li Zefan --- kernel/sched/rt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c index 1c40655..e45ec9a 100644 --- a/kernel/sched/rt.c +++ b/kernel/sched/rt.c @@ -1825,7 +1825,7 @@ static void

Re: Attaching a cgroup subsystem to multiple hierarchies

2014-02-07 Thread Li Zefan
(Add Michal back to the Cc list, and Cc cgroup mailing list) On 2014/2/7 17:21, Glyn Normington wrote: > Hi Michal > > On 6 Feb 2014, at 18:59, Michal Hocko wrote: > >> On Wed 05-02-14 14:39:52, Glyn Normington wrote: >>> Reading cgroups.txt and casting around the net leads me to believe >>>

[PATCH 3/3] jffs2: remove wait queue after schedule()

2014-02-07 Thread Li Zefan
@wait is a local variable, so if we don't remove it from the wait queue list, later wake_up() may end up accessing invalid memory. This was spotted by eyes. Cc: Signed-off-by: Li Zefan --- fs/jffs2/nodemgmt.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/jffs2/nodemgmt.c b/fs/jffs2

[PATCH 1/3] jffs2: fix unbalanced locking

2014-02-07 Thread Li Zefan
This was found by our internal debugging feature on runtime, but this bug won't lead to deadlock, as the structure that this lock is embedded in is freed on error. Cc: Signed-off-by: Li Zefan --- fs/jffs2/readinode.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fs/jffs2/readinode.c b

[PATCH 2/3] jffs2: avoid soft-lockup in jffs2_reserve_space_gc()

2014-02-07 Thread Li Zefan
) [] (do_sync_write+0x98/0xd4) [] (vfs_write+0xa8/0x150) [] (sys_write+0x3c/0xc0)] Fix this by adding a cond_resched() in the while loop. Cc: Signed-off-by: Li Zefan --- fs/jffs2/nodemgmt.c | 11 --- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/fs/jffs2/nodemgmt.c b/fs/jffs2

[PATCH 1/3] jffs2: fix unbalanced locking

2014-02-07 Thread Li Zefan
This was found by our internal debugging feature on runtime, but this bug won't lead to deadlock, as the structure that this lock is embedded in is freed on error. Cc: sta...@vger.kernel.org Signed-off-by: Li Zefan lize...@huawei.com --- fs/jffs2/readinode.c | 3 +++ 1 file changed, 3 insertions

[PATCH 2/3] jffs2: avoid soft-lockup in jffs2_reserve_space_gc()

2014-02-07 Thread Li Zefan
] (__generic_file_aio_write+0x3a4/0x414) [c00e15c0] (generic_file_aio_write+0x5c/0xbc) [c012334c] (do_sync_write+0x98/0xd4) [c0123a84] (vfs_write+0xa8/0x150) [c0123d74] (sys_write+0x3c/0xc0)] Fix this by adding a cond_resched() in the while loop. Cc: sta...@vger.kernel.org Signed-off-by: Li Zefan lize

[PATCH 3/3] jffs2: remove wait queue after schedule()

2014-02-07 Thread Li Zefan
@wait is a local variable, so if we don't remove it from the wait queue list, later wake_up() may end up accessing invalid memory. This was spotted by eyes. Cc: sta...@vger.kernel.org Signed-off-by: Li Zefan lize...@huawei.com --- fs/jffs2/nodemgmt.c | 1 + 1 file changed, 1 insertion(+) diff

Re: Attaching a cgroup subsystem to multiple hierarchies

2014-02-07 Thread Li Zefan
(Add Michal back to the Cc list, and Cc cgroup mailing list) On 2014/2/7 17:21, Glyn Normington wrote: Hi Michal On 6 Feb 2014, at 18:59, Michal Hocko mho...@suse.cz wrote: On Wed 05-02-14 14:39:52, Glyn Normington wrote: Reading cgroups.txt and casting around the net leads me to believe

[PATCH 1/2] sched/rt: Remove leaf_rt_rq_list from struct rq

2014-02-07 Thread Li Zefan
This is a leftover from commit e23ee74777f389369431d77390c4b09332ce026a (sched/rt: Simplify pull_rt_task() logic and remove .leaf_rt_rq_list). Signed-off-by: Li Zefan lize...@huawei.com --- kernel/sched/core.c | 1 - kernel/sched/sched.h | 4 2 files changed, 5 deletions(-) diff --git

[PATCH 2/2] sched/rt: Make init_sched_rt_calss() __init

2014-02-07 Thread Li Zefan
It's a bootstrap function. Signed-off-by: Li Zefan lize...@huawei.com --- kernel/sched/rt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c index 1c40655..e45ec9a 100644 --- a/kernel/sched/rt.c +++ b/kernel/sched/rt.c @@ -1825,7 +1825,7

Re: [PATCHSET cgroup/for-3.15] cgroup: convert to kernfs

2014-01-29 Thread Li Zefan
This is finally done! We'll have our most important vacation in China, so I won't be responsive until next next Monday. I'll review those patches when I come back to work. On 2014/1/29 7:54, Tejun Heo wrote: > Hello, > > cgroup filesystem code was derived from the original sysfs >

Re: [PATCHSET cgroup/for-3.15] cgroup: convert to kernfs

2014-01-29 Thread Li Zefan
This is finally done! We'll have our most important vacation in China, so I won't be responsive until next next Monday. I'll review those patches when I come back to work. On 2014/1/29 7:54, Tejun Heo wrote: Hello, cgroup filesystem code was derived from the original sysfs implementation

Re: [PATCHSET v2 cgroup/for-3.15] cgroup: drop module support and cgroup_root_mutex

2014-01-28 Thread Li Zefan
> 0001-0002 drop cgroup module support. > > 0003-0004 are cleanups. > > 0005-0006 remove cgroup_root_mutex. > Acked-by: 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 2/6] cgroup: drop module support

2014-01-28 Thread Li Zefan
> /** > - * for_each_subsys - iterate all loaded cgroup subsystems > + * for_each_subsys - iterate all enabled cgroup subsystems > * @ss: the iteration cursor > * @ssid: the index of @ss, CGROUP_SUBSYS_COUNT after reaching the end > - * > - * Iterates through all loaded subsystems. Should be

Re: [PATCH 4/4] cgroup: move the one-off opts sanity check in cgroup_root_from_opts() to parse_cgroupfs_options()

2014-01-28 Thread Li Zefan
On 2014/1/28 23:32, Tejun Heo wrote: > cgroup_root_from_opts() checks whether (!opts->subsys_mask && > !opts->none) and returns NULL if so. After that, if allocation fails, > returns ERR_PTR(-ENOMEM). The caller, cgroup_mount(), doesn't treat > NULL as an error but set opts.new_root to NULL;

Re: [PATCH 3/4] cgroup: fix locking in cgroup_cfts_commit()

2014-01-28 Thread Li Zefan
, which actually reduces LOC. > > Signed-off-by: Tejun Heo > Cc: sta...@vger.kernel.org Good catch! Acked-by: 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

Re: [PATCH 1/4] cgroup: fix error return value in cgroup_mount()

2014-01-28 Thread Li Zefan
On 2014/1/28 23:32, Tejun Heo wrote: > When cgroup_mount() fails to allocate an id for the root, it didn't > set ret before jumping to unlock_drop ending up returning 0 after a > failure. Fix it. > > Signed-off-by: Tejun Heo > Cc: sta...@vger.kernel.org Acked-by: Li Zefan

Re: [PATCH 2/4] cgroup: fix error return from cgroup_create()

2014-01-28 Thread Li Zefan
On 2014/1/28 23:32, Tejun Heo wrote: > cgroup_create() was returning 0 after allocation failures. Fix it. > > Signed-off-by: Tejun Heo > Cc: sta...@vger.kernel.org Acked-by: Li Zefan -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body

Re: [PATCH 2/4] cgroup: fix error return from cgroup_create()

2014-01-28 Thread Li Zefan
On 2014/1/28 23:32, Tejun Heo wrote: cgroup_create() was returning 0 after allocation failures. Fix it. Signed-off-by: Tejun Heo t...@kernel.org Cc: sta...@vger.kernel.org Acked-by: Li Zefan lize...@huawei.com -- To unsubscribe from this list: send the line unsubscribe linux-kernel

Re: [PATCH 1/4] cgroup: fix error return value in cgroup_mount()

2014-01-28 Thread Li Zefan
On 2014/1/28 23:32, Tejun Heo wrote: When cgroup_mount() fails to allocate an id for the root, it didn't set ret before jumping to unlock_drop ending up returning 0 after a failure. Fix it. Signed-off-by: Tejun Heo t...@kernel.org Cc: sta...@vger.kernel.org Acked-by: Li Zefan lize

Re: [PATCH 3/4] cgroup: fix locking in cgroup_cfts_commit()

2014-01-28 Thread Li Zefan
...@kernel.org Cc: sta...@vger.kernel.org Good catch! 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

Re: [PATCH 4/4] cgroup: move the one-off opts sanity check in cgroup_root_from_opts() to parse_cgroupfs_options()

2014-01-28 Thread Li Zefan
On 2014/1/28 23:32, Tejun Heo wrote: cgroup_root_from_opts() checks whether (!opts-subsys_mask !opts-none) and returns NULL if so. After that, if allocation fails, returns ERR_PTR(-ENOMEM). The caller, cgroup_mount(), doesn't treat NULL as an error but set opts.new_root to NULL; however,

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