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: [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: [PATCHSET v2 cgroup/for-3.15] cgroup: update task migration path

2014-02-25 Thread Li Zefan
_tasks.patch > 0002-cgroup-use-css_set-mg_tasks-to-track-target-tasks-du.patch > 0003-cgroup-separate-out-cset_group_from_root-from-task_c.patch > 0004-cgroup-split-process-task-migration-into-four-steps.patch > 0005-cgroup-update-how-a-newly-forked-task-gets-associate.patch > 0006

[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 Signed-off-by: Li Zefan --- fs/kernfs/mount.c | 8 +++- fs/sysfs/mount.c | 5 +++-- include/linux/kernfs.h | 9 + 3 files changed, 15 insertions(+), 7

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

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

[PATCH 2/2] cpuset: fix a race condition in __cpuset_node_allowed_softwall()

2014-02-27 Thread Li Zefan
It's not safe to access task's cpuset after releasing task_lock(). Holding callback_mutex won't help. Cc: Signed-off-by: Li Zefan --- kernel/cpuset.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/cpuset.c b/kernel/cpuset.c index 5f50ec6..c63a0d9 100644 --- a/kernel

[PATCH 1/2] cpuset: fix a locking issue in cpuset_migrate_mm()

2014-02-27 Thread Li Zefan
t from changing, and it won't prevent the original task->cgroup from destroying during this change. Fixes: 5d21cc2db040 (cpuset: replace cgroup_mutex locking with cpuset internal locking) Cc: # 3.9+ Signed-off-by: Li Zefan --- kernel/cpuset.c | 8 ++-- 1 file changed, 2 insertions(+), 6 deleti

Re: [PATCH 1/2] cpuset: fix a locking issue in cpuset_migrate_mm()

2014-02-27 Thread Li Zefan
On 2014/2/27 18:19, Li Zefan wrote: > I can trigger a lockdep warning: > > # mount -t cgroup -o cpuset xxx /cgroup > # mkdir /cgroup/cpuset > # mkdir /cgroup/tmp > # echo 0 > /cgroup/tmp/cpuset.cpus > # echo 0 > /cgroup/tmp/cpuset.mems > # echo 1 >

Re: [PATCH] cpuset: Add missing rcu read locks

2014-03-03 Thread Li Zefan
On 2014/2/27 22:20, Sasha Levin wrote: > We call task_cs() which ends up going into cgroup code without having rcu > read lock. Fix it by grabbing the lock before retrival of task_cs() and usage > of the result. > Thanks for the patch. Fengguang already reported it, and I've made a patch for

[PATCH] cpuset: use rcu_read_lock() to protect task_cs()

2014-03-03 Thread Li Zefan
We no longer use task_lock() to protect tsk->cgroups. Reported-by: Fengguang Wu Signed-off-by: Li Zefan --- kernel/cpuset.c | 24 +--- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/kernel/cpuset.c b/kernel/cpuset.c index c63a0d9..4b3560d 100

[PATCH] cpuset: use rcu_read_lock() to protect task_cs()

2014-03-03 Thread Li Zefan
We no longer use task_lock() to protect tsk->cgroups. Reported-by: Fengguang Wu Signed-off-by: Li Zefan --- kernel/cpuset.c | 24 +--- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/kernel/cpuset.c b/kernel/cpuset.c index c63a0d9..4b3560d 100

Re: [PATCH] cgroup: missing rcu read lock around task_css_set

2014-03-04 Thread Li Zefan
On 2014/3/5 3:47, Tejun Heo wrote: > On Tue, Mar 04, 2014 at 12:20:45PM -0500, Sasha Levin wrote: >>> Hrm... there is a PF_EXITING check there already: >>> >>> #define task_css_set_check(task, __c)\ >>> rcu_dereference_check((task)->cgroups,\ >>>

Re: [PATCH 1/3] kmemleak: allow freeing internal objects after disabling kmemleak

2014-03-16 Thread Li Zefan
On 2014/3/13 20:14, Catalin Marinas wrote: > On Thu, Mar 13, 2014 at 06:47:46AM +0000, Li Zefan wrote: >> +Freeing kmemleak internal objects >> +- >> + >> +To allow access to previosuly found memory leaks even when an error fatal >&g

[PATCH v2 2/3] kmemleak: remove redundant code

2014-03-16 Thread Li Zefan
- remove kmemleak_padding(). - remove kmemleak_release(). Signed-off-by: Li Zefan --- include/linux/kmemleak.h | 2 -- mm/kmemleak.c| 7 +-- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/include/linux/kmemleak.h b/include/linux/kmemleak.h index 2a5e554..5bb4246

[PATCH v2 1/3] kmemleak: allow freeing internal objects after kmemleak was disabled

2014-03-16 Thread Li Zefan
quot;off" handler instead of "clear" handler to do this, suggested by Catalin. Signed-off-by: Li Zefan --- Documentation/kmemleak.txt | 14 +- mm/kmemleak.c | 21 - 2 files changed, 29 insertions(+), 6 deletions(-) diff --git a/Docum

[PATCH v2 3/3] kmemleak: change some global variables to int

2014-03-16 Thread Li Zefan
They don't have to be atomic_t, because they are simple boolean toggles. Signed-off-by: Li Zefan --- mm/kmemleak.c | 78 +-- 1 file changed, 39 insertions(+), 39 deletions(-) diff --git a/mm/kmemleak.c b/mm/kmemleak.c index 54270f2

Re: [PATCHSET cgroup/for-3.15] cgroup: prepare for the default unified hierarchy

2014-03-17 Thread Li Zefan
++- > kernel/cgroup_freezer.c |2 > kernel/cpuset.c |2 > mm/hugetlb_cgroup.c |2 > mm/memcontrol.c |4 > net/core/netprio_cgroup.c | 2 > net/ipv4/tcp_memcontrol.c |2 > security/device_cgroup.c |

[PATCH] cgroup: fix a failure path in create_css()

2014-03-18 Thread Li Zefan
If online_css() fails, we should remove cgroup files belonging to css->ss. Signed-off-by: Li Zefan --- kernel/cgroup.c | 11 +++ 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/kernel/cgroup.c b/kernel/cgroup.c index 3790617..e673407 100644 --- a/kernel/cgroup.c ++

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

[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

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

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

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

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

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

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

[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

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] hung_task: change sysctl_hung_task_check_count to int

2013-09-13 Thread Li Zefan
it's better to fix this inconsistency. Signed-off-by: Li Zefan --- include/linux/sched/sysctl.h | 2 +- kernel/hung_task.c | 2 +- kernel/sysctl.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/linux/sched/sysctl.h b/include/linux/sched

Re: [PATCH] hung_task: change sysctl_hung_task_check_count to int

2013-09-13 Thread Li Zefan
Cc: Ingo, as this touched include/linux/sched/. On 2013/9/14 10:47, Li Zefan wrote: > As sysctl_hung_task_check_count is unsigned long, when this value is > assigned to max_count in check_hung_uninterruptible_tasks(), it's > truncated to int type. > > Therefore i

Re: [PATCH] hung_task: change sysctl_hung_task_check_count to int

2013-09-14 Thread Li Zefan
>> On 2013/9/14 10:47, Li Zefan wrote: >>> As sysctl_hung_task_check_count is unsigned long, when this value is >>> assigned to max_count in check_hung_uninterruptible_tasks(), it's >>> truncated to int type. >>> >>> Therefore if we wr

Re: [PATCH 1/2] [RFC v2] seqcount: Add lockdep functionality to seqcount/seqlock structures

2013-09-14 Thread Li Zefan
ters > and there may be more edge cases. > > Comments and feedback would be appreciated! > Could you describe how seqlocks/seqcounts can lead to deadlock in the changelog? > Cc: Mathieu Desnoyers > Cc: Li Zefan > Cc: Steven Rostedt > Cc: Peter Zijlstra > Cc: Ingo Molna

Re: [PATCH 2/2] [RFC] cpuset: Fix potential deadlock w/ set_mems_allowed

2013-09-14 Thread Li Zefan
d() function calling set_mems_allowed > with irqs enabled. While its possibly unlikely for the actual deadlock > to trigger, a fix is fairly simple: disable irqs before taking the > mems_allowed_seq lock. > Now I get it. I'm fine with this change. Acked-by: Li Zefan > Let me know

[PATCH v2 01/12] cpuset: add cs->effective_cpus and cs->effective_mems

2013-10-11 Thread Li Zefan
hild cpuset inherits its parent's effective masks. This won't introduce behavior change. v2: - s/real_{mems,cpus}_allowed/effective_{mems,cpus}, suggested by Tejun. - don't init effective masks in cpuset_css_online() if !sane_behavior Signed-off-by: Li Zefan --- kernel/cpuset.c

[PATCH v2 00/12] cpuset: separate configured masks and effective masks

2013-10-11 Thread Li Zefan
cs->effective_{mems, cpus} - splitted "cpuset: enable onlined cpu/node in effective masks" into 2 patches - exported cpuset.effective_{cpus,mems} unconditionally Li Zefan (12): cpuset: add cs->effective_cpus and cs->effective_mems cpuset: update cpuset->effective_{cpus,mems} at

[PATCH v2 02/12] cpuset: update cpuset->effective_{cpus,mems} at hotplug

2013-10-11 Thread Li Zefan
change - take on ancestor's mask when the effective mask is empty The first item is done here. This won't introduce behavior change. Signed-off-by: Li Zefan --- kernel/cpuset.c | 4 1 file changed, 4 insertions(+) diff --git a/kernel/cpuset.c b/kernel/cpuset.c index e13fc2a..d0ccde2

[PATCH v2 03/12] cpuset: update cs->effective_{cpus,mems} when config changes

2013-10-11 Thread Li Zefan
te_{cpu,node}masks_hier(), suggested by Tejun. - fix to use @cp instead of @cs in these two functions. Signed-off-by: Li Zefan --- kernel/cpuset.c | 115 1 file changed, 66 insertions(+), 49 deletions(-) diff --git a/kernel/cpuset.c b

[PATCH v2 05/12] cpuset: use effective cpumask to build sched domains

2013-10-11 Thread Li Zefan
call of rebuild_sched_domains(), suggested by Tejun. Signed-off-by: Li Zefan --- kernel/cpuset.c | 23 --- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/kernel/cpuset.c b/kernel/cpuset.c index 6723b88..360e547 100644 --- a/kernel/cpuset.c +++ b/kernel/cpuset.c @@ -49

[PATCH v2 04/12] cpuset: inherit ancestor's masks if effective_{cpus,mems} becomes empty

2013-10-11 Thread Li Zefan
change - take on ancestor's mask when the effective mask is empty This won't introduce behavior change. v2: - Add comments to explain effective masks are the same with configured masks for !sane_behavior. Signed-off-by: Li Zefan --- kernel/cpuset

[PATCH v2 06/12] cpuset: initialize top_cpuset's configured masks at mount

2013-10-11 Thread Li Zefan
As we now have to support both sane_behavior and !sane_behavior, top_cpuset's configured masks need to be initialized accordingly. Signed-off-by: Li Zefan --- kernel/cpuset.c | 19 +++ 1 file changed, 19 insertions(+) diff --git a/kernel/cpuset.c b/kernel/cpuset.c index 360e547

[PATCH v2 08/12] cpuset: make cs->{cpus,mems}_allowed as user-configured masks

2013-10-11 Thread Li Zefan
its parent's masks. This ia a behavior change, but won't take effect unless mount with sane_behavior. v2: - Add comments to explain the differences between configured masks and effective masks. Signed-off-by: Li Zefan --- kernel/cpuset.c | 51 ---

[PATCH v2 07/12] cpuset: apply cs->effective_{cpus,mems}

2013-10-11 Thread Li Zefan
th user-configured masks. Signed-off-by: Li Zefan --- kernel/cpuset.c | 83 ++--- 1 file changed, 14 insertions(+), 69 deletions(-) diff --git a/kernel/cpuset.c b/kernel/cpuset.c index 5c53ba5..040ec59 100644 --- a/kernel/cpuset.c +++ b/kernel/c

[PATCH v2 09/12] cpuset: refactor cpuset_hotplug_update_tasks()

2013-10-11 Thread Li Zefan
We mix the handling for both sane_behavior and !sane_behavior in the same function, and it's quite messy, so split into two functions. Signed-off-by: Li Zefan --- kernel/cpuset.c | 118 ++-- 1 file changed, 63 insertions(+), 55 deletions

[PATCH v2 10/12] cpuset: enable onlined cpu/node in effective masks

2013-10-11 Thread Li Zefan
ehavior won't be affected. v2: - make refactoring of cpuset_hotplug_update_tasks() as seperate patch, suggested by Tejun. - make hotplug_update_tasks_insane() use @new_cpus and @new_mems as hotplug_update_tasks_sane() does. Signed-off-by: Li Zefan --- kernel/

[PATCH v2 11/12] cpuset: allow writing offlined masks to cpuset.cpus/mems

2013-10-11 Thread Li Zefan
As the configured masks won't be limited by its parent, and the top cpuset's masks won't change when hotplug happens, it's natural to allow writing offlined masks to the configured masks. Signed-off-by; Li Zefan --- kernel/cpuset.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions

[PATCH v2 12/12] cpuset: export effective masks to userspace

2013-10-11 Thread Li Zefan
those masks unconditionally, suggested by Tejun. Signed-off-by: Li Zefan --- kernel/cpuset.c | 34 -- 1 file changed, 28 insertions(+), 6 deletions(-) diff --git a/kernel/cpuset.c b/kernel/cpuset.c index a98723d..c8ba514 100644 --- a/kernel/cpuset.c +++ b/kernel

Re: cgroup_attach_task && while_each_thread (Was: cgroup attach task - slogging cpu)

2013-10-11 Thread Li Zefan
On 2013/10/10 0:54, Oleg Nesterov wrote: > And I am starting to think that this change should also fix the > while_each_thread() problems in this particular case. > > In generak the code like > > rcu_read_lock(); > task = find_get_task(...); > rcu_read_unlock(); > >

[PATCH] cgroup: fix to break the while loop in cgroup_attach_task() correctly

2013-10-11 Thread Li Zefan
fixed the first continue, pointed out by Oleg, - rewrote changelog. ] Signed-off-by: Li Zefan --- kernel/cgroup.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/kernel/cgroup.c b/kernel/cgroup.c index a5629f1..3db1d2e 100644 --- a/kernel/cgroup.c +++ b/kernel/cgr

Re: [PATCH] slub: Fix calculation of cpu slabs

2013-10-14 Thread Li Zefan
Hi Pekka, could you pick up this patch? On 2013/9/11 5:06, Christoph Lameter wrote: > On Tue, 10 Sep 2013, Li Zefan wrote: > >> We should use page->pages instead of page->pobjects when calculating >> the number of cpu partial slabs. This also fixes the mapping of slabs

[PATCH v2] hung_task: change sysctl_hung_task_check_count to int

2013-09-23 Thread Li Zefan
truncate the user input, but reading sysctl.hung_task_check_count reflects the truncated value. v2: limit lowest value to 0. Signed-off-by: Li Zefan Acked-by: Ingo Molnar --- include/linux/sched/sysctl.h | 2 +- kernel/hung_task.c | 2 +- kernel/sysctl.c | 5 +++-- 3

[PATCH] jffs2: fix unbalanced locking

2013-09-23 Thread Li Zefan
In the failure path in jffs2_do_crccheck_inode() the lock isn't released before returning. This probably won't cause real bug, because the structure that contains the lock is freed in this case. Signed-off-by: Li Zefan --- fs/jffs2/readinode.c | 3 ++- 1 file changed, 2 insertions(+), 1

[PATCH v6 0/5] memcg, cgroup: kill css id

2013-09-23 Thread Li Zefan
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 (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 me

[PATCH v6 1/5] memcg: convert to use cgroup_is_descendant()

2013-09-23 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 7dda769..9117249 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -1405,7

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

2013-09-23 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 v6 2/5] memcg: convert to use cgroup id

2013-09-23 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 | 32 ++-- 1 file

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

2013-09-23 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 6719e2c..4e40ebe 100644 --- a/mm

[PATCH v6 5/5] cgroup: kill css_id

2013-09-23 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 Acked-by: Tejun Heo --- include/linux/cgroup.h | 37 kernel/cgroup.c| 248 +

Re: [PATCH v6 0/5] memcg, cgroup: kill css id

2013-09-23 Thread Li Zefan
On 2013/9/23 21:12, Tejun Heo wrote: > On Mon, Sep 23, 2013 at 09:08:16AM -0400, Tejun Heo wrote: >> Hello, >> >> On Mon, Sep 23, 2013 at 04:55:20PM +0800, Li Zefan wrote: >>> The whole patchset has been acked and reviewed by Michal and Tejun. >>> Could y

[PATCH] slub: Fix calculation of cpu slabs

2013-09-09 Thread Li Zefan
requiring those statistics, I just add WARN_ON for those cases. Cc: # 3.2+ Signed-off-by: Li Zefan --- mm/slub.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/mm/slub.c b/mm/slub.c index e3ba1f2..6ea461d 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -4300,7 +4300,13 @

Re: [PATCH trivial] block/ioctl.c: let code match 'kernel code style'

2013-09-03 Thread Li Zefan
Please don't. Pure colding style cleanup is discouraged. You're not going to run checkpatch.pl on the whole kernel tree and fix all the complaints, are you? On 2013/9/3 16:29, Chen Gang wrote: > For 'switch case', remove redundancy '\t' (also can let related lines > within 80 columns) and remove

Re: [PATCHSET cgroup/for-3.12] cgroup: factor out css creation into create_css()

2013-09-04 Thread Li Zefan
up_subsys_state-creation-into-.patch > 0008-cgroup-implement-for_each_css.patch > 0009-cgroup-remove-for_each_root_subsys.patch > 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.

Re: mistakes in code vs. maintainer flow mistakes

2013-07-22 Thread Li Zefan
> Perhaps what might help here is a kernel organizational chart. A graph > of who sends pull requests to Linus, and their subsystem maintainers. > For example, in the USB "branch" there would be: > > Linus Torvalds > (Linux kernel release

Re: [Ksummit-2013-discuss] [ATTEND] How to act on LKML

2013-07-22 Thread Li Zefan
On 2013/7/21 21:22, Ric Wheeler wrote: > On 07/20/2013 01:04 PM, Ben Hutchings wrote: >> n Fri, 2013-07-19 at 13:42 -0500, Felipe Contreras wrote: >>> >On Fri, Jul 19, 2013 at 7:08 AM, Ingo Molnar wrote: > > > >* Felipe Contreras wrote: >>> > > > >>As Linus already pointed out, not

Re: [Ksummit-2013-discuss] [ATTEND] How to act on LKML

2013-07-22 Thread Li Zefan
On 2013/7/23 9:39, Steven Rostedt wrote: > On Tue, 2013-07-23 at 09:26 +0800, Li Zefan wrote: > >> IT companies in China, they try to make sure there's at least one (most the >> time the result is just one) female developer/tester in a team, and a team >> is ~10 people. Ev

Re: [Ksummit-2013-discuss] KS Topic request: Handling the Stable kernel, let's dump the cc: stable tag

2013-07-22 Thread Li Zefan
On 2013/7/23 5:24, KOSAKI Motohiro wrote: >> I review what I can, but recently have often missed the 2 day review >> period. >> >> Review from the authors and maintainers is probably more valuable than >> that from generalists on the stable list. > >>From point of subsystem developers view, the

[PATCH v2] cgroup: avoid accessing modular cgroup subsys structure without locking

2013-03-04 Thread Li Zefan
ify the comment in cgroup_exit() Signed-off-by: Li Zefan --- include/linux/cgroup.h | 17 ++--- kernel/cgroup.c| 28 ++-- 2 files changed, 28 insertions(+), 17 deletions(-) diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h index 75c6ec1..5f76

[PATCH] cpuset: remove include of cgroup.h from cpuset.h

2013-03-04 Thread Li Zefan
We don't need to include cgroup.h in cpuset.h. Signed-off-by: Li Zefan --- include/linux/cpuset.h | 1 - 1 file changed, 1 deletion(-) diff --git a/include/linux/cpuset.h b/include/linux/cpuset.h index 8c8a60d..ccd1de8 100644 --- a/include/linux/cpuset.h +++ b/include/linux/cpuset.h @@ -11,7

[PATCH] perf: remove include of cgroup.h from perf_event.h

2013-03-04 Thread Li Zefan
Move struct perf_cgroup_info and perf_cgroup to kernel/perf/core.c, and then we can remove include of cgroup.h. Signed-off-by: Li Zefan --- include/linux/perf_event.h | 18 +- kernel/events/core.c | 15 +++ 2 files changed, 16 insertions(+), 17 deletions

[PATCH] res_counter: remove include of cgroup.h from res_counter.h

2013-03-04 Thread Li Zefan
It's not needed at all. Signed-off-by: Li Zefan --- include/linux/res_counter.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/res_counter.h b/include/linux/res_counter.h index 5ae8456..a83a849 100644 --- a/include/linux/res_counter.h +++ b/include/linux

[PATCH 0/9] sched: Shrink include/linux/sched.h

2013-03-05 Thread Li Zefan
While working of a cgroup patch which also touched include/linux/sched.h, I found some function/macro/structure declarations can be moved to kernel/sched/sched.h, and some can even be total removed, so here's the patchset. The result is a reduction of ~200 LOC from include/linux/sched.h.

[PATCH 1/9] sched: Remove some dummpy functions

2013-03-05 Thread Li Zefan
No one will call those functions if CONFIG_SCHED_DEBUG=n. Signed-off-by: Li Zefan --- include/linux/sched.h | 12 1 file changed, 12 deletions(-) diff --git a/include/linux/sched.h b/include/linux/sched.h index d35d2b6..2715fbb 100644 --- a/include/linux/sched.h +++ b/include

[PATCH 2/9] sched: Remove test_sd_parent()

2013-03-05 Thread Li Zefan
It's unused. Signed-off-by: Li Zefan --- include/linux/sched.h | 9 - 1 file changed, 9 deletions(-) diff --git a/include/linux/sched.h b/include/linux/sched.h index 2715fbb..e880d7d 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -959,15 +959,6 @@ extern void

[PATCH 4/9] sched: Move struct sched_group to kernel/sched/sched.h

2013-03-05 Thread Li Zefan
Move struct sched_group_power and sched_group and related inline functions to kernel/sched/sched.h, as they are used internally only. Signed-off-by: Li Zefan --- include/linux/sched.h | 58 ++- kernel/sched/sched.h | 56

[PATCH 5/9] sched: Move wake flags to kernel/sched/sched.h

2013-03-05 Thread Li Zefan
They are used internally only. Signed-off-by: Li Zefan --- include/linux/sched.h | 7 --- kernel/sched/sched.h | 7 +++ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/include/linux/sched.h b/include/linux/sched.h index 0d64130..863b505 100644 --- a/include/linux/sched.h

[PATCH 6/9] sched: Move struct sched_class to kernel/sched/sched.h

2013-03-05 Thread Li Zefan
It's used internally only. Signed-off-by: Li Zefan --- include/linux/sched.h | 59 --- kernel/sched/sched.h | 55 +++ 2 files changed, 55 insertions(+), 59 deletions(-) diff --git a/include/linux

[PATCH 3/9] sched: Move SCHED_LOAD_SHIFT macros to kernel/sched/sched.h

2013-03-05 Thread Li Zefan
They are used internally only. Signed-off-by: Li Zefan --- include/linux/sched.h | 25 - kernel/sched/sched.h | 26 +- 2 files changed, 25 insertions(+), 26 deletions(-) diff --git a/include/linux/sched.h b/include/linux/sched.h index e880d7d

[PATCH 7/9] sched: Make default_scale_freq_power() static

2013-03-05 Thread Li Zefan
As default_scale_{freq,smt}_power() and update_rt_power() are used in kernel/sched/fair.c only, annotate them as static functions. Signed-off-by: Li Zefan --- include/linux/sched.h | 3 --- kernel/sched/fair.c | 6 +++--- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/include

[PATCH 8/9] sched: Move group scheduling functions out of include/linux/sched.h

2013-03-05 Thread Li Zefan
- Make sched_group_{set_,}runtime(), sched_group_{set_,}period() and sched_rt_can_attach() static. - Move sched_{create,destroy,online,offline}_group() to kernel/sched/sched.h. - Remove declaration of sched_group_shares(). Signed-off-by: Li Zefan --- include/linux/sched.h | 21

[PATCH 9/9] sched: Remove double declaration of root_task_group

2013-03-05 Thread Li Zefan
It's already declared in include/linux/sched.h Signed-off-by: Li Zefan --- kernel/sched/core.c | 4 kernel/sched/sched.h | 5 - 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 9ad26c9..42ecbcb 100644 --- a/kernel/sched

Re: [PATCH] perf: remove include of cgroup.h from perf_event.h

2013-03-05 Thread Li Zefan
On 2013/3/5 16:33, Stephane Eranian wrote: > On Tue, Mar 5, 2013 at 4:38 AM, Li Zefan wrote: >> Move struct perf_cgroup_info and perf_cgroup to kernel/perf/core.c, >> and then we can remove include of cgroup.h. >> >> Signed-off-by: Li Zefan >> --- &g

<    8   9   10   11   12   13   14   15   16   17   >