Re: [PATCH 2/8] cgroup: kill CSS_REMOVED

2012-11-04 Thread Li Zefan
n local_irq_disable/enable() > added per Michal Hocko. > > Signed-off-by: Tejun Heo > Reviewed-by: Michal Hocko > Cc: Johannes Weiner > Cc: Balbir Singh > Cc: KAMEZAWA Hiroyuki Acked-by: Li Zefan -- To unsubscribe from this list: send the line "unsubscribe linux-k

Re: [PATCH 1/8] cgroup: kill cgroup_subsys->__DEPRECATED_clear_css_refs

2012-11-04 Thread Li Zefan
atomic against css_tryget() and will be removed by future > changes. > > v2: cgroup_call_pre_destroy() removal dropped per Michal. Commit > message updated to explain local_irq_disable/enable() conversion. > > Signed-off-by: Tejun Heo > Reviewed-by: Michal Hocko Acked-

Re: [PATCH 3/8] cgroup: use cgroup_lock_live_group(parent) in cgroup_create()

2012-11-04 Thread Li Zefan
ecessary. > > Do it anyway such that locking is contained inside cgroup proper and > we don't get nasty surprises if we ever grow another caller of > cgroup_create(). > > Signed-off-by: Tejun Heo > Reviewed-by: Michal Hocko Acked-by: Li Zefan -- To unsubscribe from

Re: [PATCH 4/8] cgroup: deactivate CSS's and mark cgroup dead before invoking ->pre_destroy()

2012-11-04 Thread Li Zefan
t; v2: cgroup_call_pre_destroy() removal moved to this patch per Michal. > Commit message updated per Glauber. > > Signed-off-by: Tejun Heo > Reviewed-by: Michal Hocko > Cc: Glauber Costa 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 5/8] cgroup: remove CGRP_WAIT_ON_RMDIR, cgroup_exclude_rmdir() and cgroup_release_and_wakeup_rmdir()

2012-11-04 Thread Li Zefan
albir Singh > Cc: KAMEZAWA Hiroyuki > --- > include/linux/cgroup.h | 21 - > kernel/cgroup.c| 51 > -- > mm/memcontrol.c| 24 +--- > 3 files changed, 1 insertion(+), 95

Re: [PATCH 8/8] cgroup: make ->pre_destroy() return void

2012-11-04 Thread Li Zefan
On 2012/11/1 3:44, Tejun Heo wrote: > All ->pre_destory() implementations return 0 now, which is the only > allowed return value. Make it return void. > > Signed-off-by: Tejun Heo > Cc: Michal Hocko > Cc: Balbir Singh > Cc: KAMEZAWA Hiroyuki > Cc: Vivek Goyal

Re: [PATCH V2] relay: fix timer madness

2013-07-09 Thread Li Zefan
On 2013/7/10 10:18, zhangwei(Jovi) wrote: > When I'm using ktap script to tracing all event tracepoints by relay > transport, without this patch, the system will hang in few seconds. > > I found the original patch discussion in 2007. > http://marc.info/?l=linux-kernel&m=118544794717162&w=2 > (In t

Re: When to push bug fixes to mainline

2013-07-11 Thread Li Zefan
On 2013/7/12 8:50, Theodore Ts'o wrote: > On Thu, Jul 11, 2013 at 03:01:17PM -0700, Greg Kroah-Hartman wrote: >> >> I'm sitting on top of over 170 more patches that have been marked for >> the stable releases right now that are not included in this set of >> releases. The fact that there ar

[PATCH] hung_task: change sysctl_hung_task_check_count to int

2013-09-13 Thread Li Zefan
still 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/l

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

Re: [PATCH] hung_task: change sysctl_hung_task_check_count to int

2013-09-13 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

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

2013-09-14 Thread Li Zefan
ted seqlock writers > 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 >

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

2013-09-14 Thread Li Zefan
.080042] *** DEADLOCK *** > > The issue stems from the kthreadd() 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

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

2013-09-04 Thread Li Zefan
roup-factor-out-cgroup_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 ma

[PATCH] slub: Fix calculation of cpu slabs

2013-09-09 Thread Li Zefan
interfaces 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

Re: [PATCH 1/9] cgroup: fix css leaks on online_css() failure

2013-09-02 Thread Li Zefan
On 2013/8/29 5:03, Tejun Heo wrote: > ae7f164a09 ("cgroup: move cgroup->subsys[] assignment to > online_css()") moved cgroup->subsys[] assignements later in > cgroup_create() but didn't update error handling path accordingly > leaking later css's after an online_css() failure. > > This patch moves

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

[PATCH v2] hung_task: change sysctl_hung_task_check_count to int

2013-09-23 Thread Li Zefan
still 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 +++

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

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

2013-09-23 Thread Li Zefan
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 (5): memcg: convert to use cgroup_is_descendant() memcg: convert to use cgroup id memcg: fail to create cgroup if the cgroup id is to

[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

Re: [REGRESSION] cgroup: notify_on_release may not be triggered in some cases

2012-10-07 Thread Li Zefan
e > commit:74a1166d(cgroups: make procs file writable), which was merged > into v3.0. > > Cc: Ben Blum > Cc: Tejun Heo > Cc: Li Zefan > Cc: # v3.0.x and later > Signed-off-by: Daisuke Nishimura > --- > This patch is based on v3.6. > > kernel/cgroup.c |3 +--

Re: [PATCH 1/7] cgroup: cgroup_subsys->fork() should be called after the task is added to css_set

2012-10-17 Thread Li Zefan
On 2012/10/17 6:28, Tejun Heo wrote: > cgroup core has a bug which violates a basic rule about event > notifications - when a new entity needs to be added, you add that to > the notification list first and then make the new entity conform to > the current state. If done in the reverse order, an ev

Re: [PATCH 1/7] cgroup: cgroup_subsys->fork() should be called after the task is added to css_set

2012-10-17 Thread Li Zefan
于 2012/10/17 16:28, Li Zefan 写道: > On 2012/10/17 6:28, Tejun Heo wrote: >> cgroup core has a bug which violates a basic rule about event >> notifications - when a new entity needs to be added, you add that to >> the notification list first and then make the new entity conf

Re: [PATCH 5/6] memcg: make mem_cgroup_reparent_charges non failing

2012-10-18 Thread Li Zefan
> static int mem_cgroup_force_empty_write(struct cgroup *cont, unsigned int > event) > @@ -5013,13 +5011,9 @@ free_out: > static int mem_cgroup_pre_destroy(struct cgroup *cont) > { > struct mem_cgroup *memcg = mem_cgroup_from_cont(cont); > - int ret; > > - css_get(&memcg->css);

Re: Is not locking task_lock in cgroup_fork() safe?

2012-10-19 Thread Li Zefan
On 2012/10/19 8:58, Tejun Heo wrote: > Hello, again. > > On Thu, Oct 18, 2012 at 05:38:35PM -0700, Tejun Heo wrote: >> Even if there isn't an actual race, the comment is dead wrong. I'm >> reverting the following three patches. Let's try again later. >> >> 7e381b0eb1 ("cgroup: Drop task_lock(p

Re: [PATCH 4/6] cgroups: forbid pre_destroy callback to fail

2012-10-19 Thread Li Zefan
On 2012/10/17 21:30, Michal Hocko wrote: > Now that mem_cgroup_pre_destroy callback doesn't fail finally we can > safely move on and forbit all the callbacks to fail. The last missing > piece is moving cgroup_call_pre_destroy after cgroup_clear_css_refs so > that css_tryget fails so no new charges

Re: [PATCHSET cgroup/for-3.8] cpuset: decouple cpuset locking from cgroup core

2012-12-05 Thread Li Zefan
On 2012/12/4 0:53, Tejun Heo wrote: > Hello, Michal. > > On Mon, Dec 03, 2012 at 04:22:05PM +0100, Michal Hocko wrote: >> I have glanced through the series and spotten nothing obviously wrong. I >> do not feel I could give my r-b because I am not familiar with cpusets >> internals enough and some

Re: [RFC] rework mem_cgroup iterator

2012-11-13 Thread Li Zefan
On 2012/11/13 23:30, Michal Hocko wrote: > Hi all, > this patch set tries to make mem_cgroup_iter saner in the way how it > walks hierarchies. css->id based traversal is far from being ideal as it > is not deterministic because it depends on the creation ordering. > > Diffstat looks promising but

Re: [PATCH 04/17] cgroup: create directory before linking while creating a new cgroup

2012-11-13 Thread Li Zefan
On 2012/11/13 11:01, Tejun Heo wrote: > While creating a new cgroup, cgroup_create() links the newly allocated > cgroup into various places before trying to create its directory. > Because cgroup life-cycle is tied to the vfs objects, this makes it > impossible to use cgroup_rmdir() for rolling bac

Re: [PATCH 1/9 v3] cgroup: add cgroup_subsys->post_create()

2012-11-09 Thread Li Zefan
n be used to implement reliable state > inheritance. It will be explained with the descendant iterators. > > v2: Added a paragraph about its future use w/ descendant iterators per > Michal. > > v3: Forgot to add ->post_create() invocation to cgroup_load_subsys(). > Fixe

Re: [PATCH 1/9 v3] cgroup: add cgroup_subsys->post_create()

2012-11-09 Thread Li Zefan
> > Signed-off-by: Tejun Heo > Acked-by: Michal Hocko > Reviewed-by: KAMEZAWA Hiroyuki > Cc: Glauber Costa 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/9] cgroup: Use rculist ops for cgroup->children

2012-11-09 Thread Li Zefan
children list instead of head. This isn't strictly necessary but is > done so that the iteration order is more conventional. > > Signed-off-by: Tejun Heo Acked-by: Li Zefan -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a mes

Re: [PATCH 3/9 v2] cgroup: implement generic child / descendant walk macros

2012-11-09 Thread Li Zefan
2: s/config/state/ in commit message and comments per Michal. More > documentation on synchronization rules. > > Signed-off-by: Tejun Heo > Reviewed-by: KAMEZAWA Hiroyuki > Reviewed-by: Michal Hocko I don't see anything wrong with the comment on cgroup_next_descendant_pr

[PATCH] netprio_cgroup: define sk_cgrp_prioidx only if NETPRIO_CGROUP is enabled

2012-12-25 Thread Li Zefan
sock->sk_cgrp_prioidx won't be used at all if CONFIG_NETPRIO_CGROUP=n. Signed-off-by: Li Zefan --- include/net/sock.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/net/sock.h b/include/net/sock.h index 93a6745..182ca99 100644 --- a/include/net/sock.h +++ b

Re: [PATCH 06/13] cpuset: cleanup cpuset[_can]_attach()

2012-12-26 Thread Li Zefan
On 2012/11/29 5:34, Tejun Heo wrote: > cpuset_can_attach() prepare global variables cpus_attach and > cpuset_attach_nodemask_{to|from} which are used by cpuset_attach(). > There is no reason to prepare in cpuset_can_attach(). The same > information can be accessed from cpuset_attach(). > > Move t

Re: [PATCHSET cgroup/for-3.8] cpuset: decouple cpuset locking from cgroup core

2012-12-26 Thread Li Zefan
On 2012/11/29 5:34, Tejun Heo wrote: > Hello, guys. > > Depending on cgroup core locking - cgroup_mutex - is messy and makes > cgroup prone to locking dependency problems. The current code already > has lock dependency loop - memcg nests get_online_cpus() inside > cgroup_mutex. cpuset the other

[PATCH] userns: Allow unprivileged reboot

2012-12-26 Thread Li Zefan
In a container with its own pid namespace and user namespace, rebooting the system won't reboot the host, but terminate all the processes in it and thus have the container shutdown, so it's safe. Signed-off-by: Li Zefan --- kernel/sys.c | 5 +++-- 1 file changed, 3 insertions(+), 2

Re: [PATCH v3 7/7] cgroup: remove css_get_next

2013-01-03 Thread Li Zefan
On 2013/1/4 1:54, Michal Hocko wrote: > Now that we have generic and well ordered cgroup tree walkers there is > no need to keep css_get_next in the place. > > Signed-off-by: Michal Hocko > Acked-by: KAMEZAWA Hiroyuki Acked-by: Li Zefan > --- > include/

Re: [PATCH 04/17] cgroup: create directory before linking while creating a new cgroup

2012-11-15 Thread Li Zefan
On 2012/11/15 3:04, Tejun Heo wrote: > Hello, Li. > > On Wed, Nov 14, 2012 at 11:20:47AM +0800, Li Zefan wrote: >>> It also removes the need to check whether cgroup->dentry is %NULL in >>> cgroup_path. If a cgroup is visible, its dentry is guaranteed to be >>

Re: [PATCH 1/2] cgroup: s/CGRP_CLONE_CHILDREN/CGRP_CPUSET_CLONE_CHILDREN/

2012-11-18 Thread Li Zefan
flect that and update documentation. Also, drop > clone_children() wrapper in cgroup.c. The thin wrapper is used only a > few times and one of them will go away soon. > > Signed-off-by: Tejun Heo > Cc: Glauber Costa Acked-by: Li Zefan -- To unsubscribe from this list: send the line "

Re: [PATCH 2/2] cgroup, cpuset: remove cgroup_subsys->post_clone()

2012-11-18 Thread Li Zefan
cgroup_subsys->post_clone(). > > Loosely based on Glauber's "generalize post_clone into post_create" > patch. > > Signed-off-by: Tejun Heo > Original-patch-by: Glauber Costa > Original-patch: <1351686554-22592-2-git-send-email-glom...@parallels.com> > Cc:

Re: [PATCH 01/17] cgroup: remove incorrect dget/dput() pair in cgroup_create_dir()

2012-11-19 Thread Li Zefan
On 2012/11/13 11:01, Tejun Heo wrote: > cgroup_create_dir() does weird dancing with dentry refcnt. On > success, it gets and then puts it achieving nothing. On failure, it > puts but there isn't no matching get anywhere leading to the following > oops if cgroup_create_file() fails for whatever re

Re: [PATCHSET cgroup/for-3.8] cgroup: allow ->post_create() to fail

2012-11-19 Thread Li Zefan
2-cgroup-introduce-CSS_ONLINE-flag-and-on-offline_css-.patch > 0013-cgroup-simplify-cgroup_load_subsys-failure-path.patch > 0014-cgroup-use-mutex_trylock-when-grabbing-i_mutex-of-a-.patch > 0015-cgroup-update-cgroup_create-failure-path.patch > 0016-cgroup-allow-post_create-to-fail.pa

Re: [PATCH 06/17] cgroup: remove duplicate RCU free on struct cgroup

2012-11-19 Thread Li Zefan
On 2012/11/13 11:01, Tejun Heo wrote: > struct cgroup is made RCU-safe by synchronize_rcu() in cgroup_diput(). but synchronize_rcu() is called before ss->destroy(). rcu_read_lock(); for_each_leaf_cfs_rq(cpu_rq(cpu), cfs_rq) print_cfs_rq(m, cpu, cfs_rq); -> call cgroup_path(task_gr

Re: [PATCH 1/8] cgroup: add cgroup->id

2012-11-19 Thread Li Zefan
s_alloc(). > > This patch adds cgroup->id, which is a simple per-hierarchy > ida-allocated ID which is assigned before ->css_alloc() and released > after ->css_free(). > > Signed-off-by: Tejun Heo Acked-by: Li Zefan -- To unsubscribe from this list: send the line "u

Re: cgroup: status-quo and userland efforts

2013-04-16 Thread Li Zefan
On 2013/4/17 1:10, Tejun Heo wrote: > Hello, Li. > > On Tue, Apr 16, 2013 at 07:17:17PM +0800, Li Zefan wrote: > ... >>> hot-unplug). It currently transfers all its tasks to the nearest >>> ancestor with executing resources, which is an irreversible process >&

Re: [PATCH 25/28] proc: Supply an accessor to get the process ID associated with some proc files [RFC]

2013-04-16 Thread Li Zefan
On 2013/4/17 2:27, David Howells wrote: > Supply an accessor to get the process ID associated with some proc files and > directories (get_proc_pid()). > > Signed-off-by: David Howells > cc: Tejun Heo > cc: Li Zefan > cc: contain...@lists.linux-foundation.org > cc:

[PATCH] cgroup: fix broken file xattrs

2013-04-18 Thread Li Zefan
same struct simple_xattrs twice. Cc: # 3.8.x Reported-by: Alexey Kodanev Signed-off-by: Li Zefan --- This patch is based on 3.9-rcX. It conflicts a bit with "cgroup: convert cgroupfs_root flag bits to masks and add CGRP_ prefix" --- include/linux/cgroup.h | 3 --- kernel/cgroup.c

[PATCH 00/10] cpuset: implement sane hierarchy behaviors

2013-04-19 Thread Li Zefan
ps which can be applied no matter if the last 4 patches are acceptable or not. Li Zefan (10): cpuset: remove redundant check in cpuset_cpus_allowed_fallback() cpuset: cleanup guarantee_online_{cpus|mems}() cpuset: remove unnecessary variable in cpuset_attach()

[PATCH 01/10] cpuset: remove redundant check in cpuset_cpus_allowed_fallback()

2013-04-19 Thread Li Zefan
task_cs() will never return NULL. Signed-off-by: Li Zefan --- kernel/cpuset.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/kernel/cpuset.c b/kernel/cpuset.c index 866d78e..4a62dcc 100644 --- a/kernel/cpuset.c +++ b/kernel/cpuset.c @@ -2259,8 +2259,7 @@ void

[PATCH 03/10] cpuset: remove unnecessary variable in cpuset_attach()

2013-04-19 Thread Li Zefan
We can just use oldcs->mems_allowed. Signed-off-by: Li Zefan --- kernel/cpuset.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/kernel/cpuset.c b/kernel/cpuset.c index 6f9d5e0..66302a9 100644 --- a/kernel/cpuset.c +++ b/kernel/cpuset.c @@ -1406,8 +1406,7 @@ sta

[PATCH 02/10] cpuset: cleanup guarantee_online_{cpus|mems}()

2013-04-19 Thread Li Zefan
- We never pass a NULL @cs to these functions. - The top cpuset always has some online cpus/mems. Signed-off-by: Li Zefan --- kernel/cpuset.c | 29 +++-- 1 file changed, 7 insertions(+), 22 deletions(-) diff --git a/kernel/cpuset.c b/kernel/cpuset.c index 4a62dcc

[PATCH 04/10] cpuset: remove cpuset_test_cpumask()

2013-04-19 Thread Li Zefan
The test is done in set_cpus_allowed_ptr(), so it's redundant. Signed-off-by: Li Zefan --- kernel/cpuset.c | 19 +-- 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/kernel/cpuset.c b/kernel/cpuset.c index 66302a9..8b0e433 100644 --- a/kernel/cpuset.c +++ b/k

[PATCH 05/10] cpuset: don't update tasks' cpumask and nodemask in an empty cpuset

2013-04-19 Thread Li Zefan
Signed-off-by: Li Zefan --- kernel/cpuset.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/kernel/cpuset.c b/kernel/cpuset.c index 8b0e433..2e4c5af 100644 --- a/kernel/cpuset.c +++ b/kernel/cpuset.c @@ -2013,7 +2013,9 @@ static void cpuset_propagate_hotplug_wor

[PATCH 06/10] cpuset: re-structure update_cpumask() a bit

2013-04-19 Thread Li Zefan
won't fail */ Without this patch, the last operation will fail. Signed-off-by: Li Zefan --- kernel/cpuset.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/kernel/cpuset.c b/kernel/cpuset.c index 2e4c5af..63a5343 100644 --- a/kernel/cpuset.c +++ b/kernel/cpuset.c @@

[PATCH 07/10] cpuset: record old_mems_allowed in struct cpuset

2013-04-19 Thread Li Zefan
s it by saving old mems_allowed in cpuset->old_mems_allowed. This currently won't change any behavior, but it will later allow us to keep tasks in empty cpusets. Signed-off-by: Li Zefan --- kernel/cpuset.c | 62 + 1 file cha

[PATCH 08/10] cpuset: introduce effective_{cpumask|nodemask}_cpuset()

2013-04-19 Thread Li Zefan
s in empty cpusets. Signed-off-by: Li Zefan --- kernel/cpuset.c | 76 - 1 file changed, 65 insertions(+), 11 deletions(-) diff --git a/kernel/cpuset.c b/kernel/cpuset.c index c4f9ebd..741e652 100644 --- a/kernel/cpuset.c +++ b/kernel/cpuset.c

[PATCH 09/10] cpuset: allow to keep tasks in empty cpusets

2013-04-19 Thread Li Zefan
To achieve this: - We call update_tasks_cpumask/nodemask() for empty cpusets when hotplug happens, instead of moving tasks out of them. - When a cpuset's masks are changed by writing cpuset.cpus/mems, we also update tasks in child cpusets which are empty. Signed-off-by: Li Zefan --- k

[PATCH 10/10] cpuset: allow to move tasks to empty cpusets

2013-04-19 Thread Li Zefan
rules: - They can be moved to another cpuset, regardless it's empty or not. - Though it takes masks from ancestors, it takes other configs from the empty cpuset. - If the ancestors' masks are changed, those tasks will also be updated to take new masks. Signed-off-by: Li Zefan ---

Re: [PATCH 05/10] cpuset: don't update tasks' cpumask and nodemask in an empty cpuset

2013-04-19 Thread Li Zefan
On 2013/4/20 2:36, Tejun Heo wrote: > Hello, Li. > > On Fri, Apr 19, 2013 at 08:27:05PM +0800, Li Zefan wrote: >> I think this was introduced unintentionally when cpuset hotplug was >> made asynchronous. Fortunately it does no harm, as updating tasks' >> cpum

Re: [PATCH 09/10] cpuset: allow to keep tasks in empty cpusets

2013-04-19 Thread Li Zefan
On 2013/4/20 4:58, Tejun Heo wrote: > Hello, > > On Fri, Apr 19, 2013 at 08:29:24PM +0800, Li Zefan wrote: >> +static void update_tasks_cpumask_hier(struct cpuset *root_cs, >> + bool update_root, struct ptr_heap *heap) >> +

Re: [PATCH 3.0-stable 1/2] tracing: Fix possible NULL pointer dereferences

2013-06-12 Thread Li Zefan
On 2013/6/11 5:13, Greg Kroah-Hartman wrote: > On Fri, Jun 07, 2013 at 05:00:33PM +0800, Li Zefan wrote: >> commit 6a76f8c0ab19f215af2a3442870eeb5f0e81998d upstream. >> >> Currently set_ftrace_pid and set_graph_function files use seq_lseek >> for their fops. However se

Re: [PATCH 03/11] cgroup: bring some sanity to naming around cg_cgroup_link

2013-06-12 Thread Li Zefan
On 2013/6/13 5:03, Tejun Heo wrote: > cgroups and css_sets are mapped M:N and this M:N mapping is > represented by struct cg_cgroup_link which points to forms linked > lists on both sides. The naming around this already confusing struct > is pretty bad. > >>From cgroup side, it starts off ->css_s

Re: [PATCH 04/11] cgroup: use kzalloc() and list_del_init()

2013-06-12 Thread Li Zefan
On 2013/6/13 5:03, Tejun Heo wrote: > There's no point in using kmalloc() and list_del() instead of the > clearing variants for trivial stuff. We can live dangerously > elsewhere. Use kzalloc() and list_del_init() instead and drop 0 > inits. > Do you mean we prefer list_del_init() than list_del

Re: [PATCH 05/11] cgroup: clean up css_[try]get() and css_put()

2013-06-12 Thread Li Zefan
On 2013/6/13 5:03, Tejun Heo wrote: > * __css_get() isn't used by anyone. Fold it into css_get(). > > * Add proper function comments to all css reference functions. > > This patch is purely cosmetic. > > Signed-off-by: Tejun Heo > --- > include/linux/cgroup.h | 48

Re: [PATCH 04/11] cgroup: use kzalloc() and list_del_init()

2013-06-12 Thread Li Zefan
On 2013/6/13 10:38, Kent Overstreet wrote: > On Thu, Jun 13, 2013 at 10:36:40AM +0800, Li Zefan wrote: >> On 2013/6/13 5:03, Tejun Heo wrote: >>> There's no point in using kmalloc() and list_del() instead of the >>> clearing variants for trivial stuff. We can live

Re: [PATCHSET v2 cgroup/for-3.11] cgroup: convert cgroup_subsys_state refcnt to percpu_ref

2013-06-12 Thread Li Zefan
oup: clean up the cftype array for the base > cgroup files") > + [1] percpu/review-percpu-ref-tryget > > and available in the following git branch. > > git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup.git > review-css-percpu-ref > > diffstat follows. Thank

Re: [PATCH v3 0/7] cpuset: implement sane hierarchy behaviors

2013-06-13 Thread Li Zefan
On 2013/6/10 0:03, Tejun Heo wrote: > Hello, Li. > > On Sun, Jun 09, 2013 at 05:14:02PM +0800, Li Zefan wrote: >> v2 -> v3: >> Currently some cpuset behaviors are not friendly when cpuset is co-mounted >> with other cgroup controllers. >> >> Now wi

[PATCH v4 7/7] cpuset: fix to migrate mm correctly in a corner case

2013-06-13 Thread Li Zefan
= ancestor's nodemask. so looks like no pages will be migrated. Fix this by: - Don't call update_tasks_nodemask() on empty cpusets. - Pass cs->old_mems_allowed to do_migrate_pages(). v4: added comment in cpuset_hotplug_update_tasks() and rephased comment in cpuset_attach(). Sign

[PATCH v3 5/9] memcg: use css_get/put when charging/uncharging kmem

2013-06-13 Thread Li Zefan
b() in kmem_cgroup_css_offline(), pointed out by Michal - revised comments as suggested by Michal - fixed to check if kmem is activated in kmem_cgroup_css_offline() Signed-off-by: Li Zefan Acked-by: Michal Hocko Acked-by: KAMEZAWA Hiroyuki --- mm/memcontrol.c | 70 +++

Re: [cgroup_init_early] WARNING: at mm/percpu.c:292 pcpu_mem_zalloc()

2013-06-13 Thread Li Zefan
On 2013/6/14 7:00, Fengguang Wu wrote: > Greetings, > > I got the below dmesg and the first bad commit is > > commit f284b77333b1320491f138b76f11006bbc962569 > Author: Tejun Heo > Date: Wed Jun 12 13:50:58 2013 -0700 > > cgroup: use percpu refcnt for cgroup_subsys_states > You were

Re: [PATCH v3 5/9] memcg: use css_get/put when charging/uncharging kmem

2013-06-13 Thread Li Zefan
>> static void memcg_kmem_mark_dead(struct mem_cgroup *memcg) >> { >> +/* >> + * We need to call css_get() first, because memcg_uncharge_kmem() >> + * will call css_put() if it sees the memcg is dead. >> + */ >> +smb_wmb(); >> if (test_bit(KMEM_ACCOUNTED_ACTIVE, &memcg->k

[PATCH v4 1/9] Revert "memcg: avoid dangling reference count in creation failure."

2013-06-13 Thread Li Zefan
-by: Michal Hocko Signed-off-by: Li Zefan Acked-by: KAMEZAWA Hiroyuki --- mm/memcontrol.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 2e851f4..0bacc0d 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -6332,8 +6332,6 @@ mem_cgroup_css_online

[PATCH v4 0/9] memcg: make memcg's life cycle the same as cgroup

2013-06-13 Thread Li Zefan
onvert memcg to use cgroup->id, and then we can kill css_id. Li Zefan (7): memcg: use css_get() in sock_update_memcg() memcg: don't use mem_cgroup_get() when creating a kmemcg cache memcg: use css_get/put when charging/uncharging kmem memcg: use css_get/put for swap memcg memcg

[PATCH v4 3/9] memcg: use css_get() in sock_update_memcg()

2013-06-13 Thread Li Zefan
Use css_get/css_put instead of mem_cgroup_get/put. Note, if at the same time someone is moving @current to a different cgroup and removing the old cgroup, css_tryget() may return false, and sock->sk_cgrp won't be initialized, which is fine. Signed-off-by: Li Zefan Acked-by: KAMEZAWA

[PATCH v4 7/9] memcg: don't need to get a reference to the parent

2013-06-13 Thread Li Zefan
The cgroup core guarantees it's always safe to access the parent. v2: - added a comment in mem_cgroup_put() as suggested by Michal - removed mem_cgroup_get(), otherwise gcc will warn that it's not used Signed-off-by: Li Zefan Acked-by: Michal Hocko Acked-by: KAMEZAWA Hiroyuk

[PATCH v4 8/9] memcg: kill memcg refcnt

2013-06-13 Thread Li Zefan
Now memcg has the same life cycle as its corresponding cgroup. Kill the useless refcnt. Signed-off-by: Li Zefan Acked-by: Michal Hocko Acked-by: KAMEZAWA Hiroyuki --- mm/memcontrol.c | 18 +- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/mm/memcontrol.c b/mm

[PATCH v4 2/9] memcg, kmem: fix reference count handling on the error path

2013-06-13 Thread Li Zefan
e any reference. This all suggests that it should be memcg_propagate_kmem that should clean up after itself so this patch moves mem_cgroup_put over there. Unfortunately this is not that easy (as pointed out by Li Zefan) because memcg_kmem_mark_dead marks the group dead (KMEM_ACCOUNTED_DEAD) if

[PATCH v4 6/9] memcg: use css_get/put for swap memcg

2013-06-13 Thread Li Zefan
e situation has changed so that rmdir a cgroup will succeed regardless css refs, but won't be freed until css refs goes down to 0. Signed-off-by: Li Zefan Acked-by: Michal Hocko Acked-by: KAMEZAWA Hiroyuki --- mm/memcontrol.c | 26 -- 1 file changed, 16 inserti

[PATCH v4 4/9] memcg: don't use mem_cgroup_get() when creating a kmemcg cache

2013-06-13 Thread Li Zefan
css_put. (This changelog is mostly written by Glauber) Signed-off-by: Li Zefan Acked-by: Michal Hocko Acked-by: KAMEZAWA Hiroyuki --- mm/memcontrol.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/mm/memcontrol.c b/mm/memcontrol.c index a8e8d2a..466c595 100644

[PATCH v4 5/9] memcg: use css_get/put when charging/uncharging kmem

2013-06-13 Thread Li Zefan
added wmb() in kmem_cgroup_css_offline(), pointed out by Michal - revised comments as suggested by Michal - fixed to check if kmem is activated in kmem_cgroup_css_offline() Signed-off-by: Li Zefan Acked-by: Michal Hocko Acked-by: KAMEZAWA Hiroyuki Reviewed-by: Tejun Heo --- mm/me

[PATCH v4 9/9] memcg: don't need to free memcg via RCU or workqueue

2013-06-13 Thread Li Zefan
("memcg: free mem_cgroup by RCU to fix oops"). Cc: Hugh Dickins Signed-off-by: Li Zefan Acked-by: Michal Hocko Acked-by: KAMEZAWA Hiroyuki --- mm/memcontrol.c | 51 +-- 1 file changed, 5 insertions(+), 46 deletions(-) diff --git a/mm/memc

[PATCH ] cgroup: rename cont to cgrp

2013-06-13 Thread Li Zefan
Cont is short for container. control group was named process container at first, but then people found container already has a meaning in linux kernel. Clean up the leftover variable name @cont. Signed-off-by: Li Zefan --- I'll clean up this for memcg later. --- include/linux/cgroup.h

[PATCH] cpuset: rename cont to cgrp

2013-06-13 Thread Li Zefan
Cont is short for container. control group was named process container at first, but then people found container already has a meaning in linux kernel. Clean up the leftover variable name @cont. Signed-off-by: Li Zefan --- kernel/cpuset.c | 32 1 file changed

[PATCH v2 02/10] cpuset: cleanup guarantee_online_{cpus|mems}()

2013-06-05 Thread Li Zefan
- We never pass a NULL @cs to these functions. - The top cpuset always has some online cpus/mems. Signed-off-by: Li Zefan --- kernel/cpuset.c | 29 +++-- 1 file changed, 7 insertions(+), 22 deletions(-) diff --git a/kernel/cpuset.c b/kernel/cpuset.c index f0c884a

[PATCH v2 03/10] cpuset: remove unnecessary variable in cpuset_attach()

2013-06-05 Thread Li Zefan
We can just use oldcs->mems_allowed. Signed-off-by: Li Zefan --- kernel/cpuset.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/kernel/cpuset.c b/kernel/cpuset.c index d753837..dbef832 100644 --- a/kernel/cpuset.c +++ b/kernel/cpuset.c @@ -1407,8 +1407,7 @@ sta

[PATCH v2 04/10] cpuset: remove cpuset_test_cpumask()

2013-06-05 Thread Li Zefan
The test is done in set_cpus_allowed_ptr(), so it's redundant. Signed-off-by: Li Zefan --- kernel/cpuset.c | 19 +-- 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/kernel/cpuset.c b/kernel/cpuset.c index dbef832..51f8e1d 100644 --- a/kernel/cpuset.c +++ b/k

[PATCH v2 00/10] cpuset: implement sane hierarchy behaviors

2013-06-05 Thread Li Zefan
ancestors, it takes other configs from the empty cpuset. - If the ancestors' masks are changed, those tasks will also be updated to take new masks. Li Zefan (10): cpuset: remove redundant check in cpuset_cpus_allowed_fallback() cpuset: cleanup guarantee_online_{cpus|mems}()

[PATCH v2 05/10] cpuset: re-structure update_cpumask() a bit

2013-06-05 Thread Li Zefan
won't fail */ Without this patch, the last operation will fail. Signed-off-by: Li Zefan --- kernel/cpuset.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/kernel/cpuset.c b/kernel/cpuset.c index 51f8e1d..535dce6 100644 --- a/kernel/cpuset.c +++ b/kernel/cpuset.c @@

[PATCH v2 01/10] cpuset: remove redundant check in cpuset_cpus_allowed_fallback()

2013-06-05 Thread Li Zefan
task_cs() will never return NULL. Signed-off-by: Li Zefan --- kernel/cpuset.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/kernel/cpuset.c b/kernel/cpuset.c index 64b3f79..f0c884a 100644 --- a/kernel/cpuset.c +++ b/kernel/cpuset.c @@ -2253,8 +2253,7 @@ void

[PATCH v2 08/10] cpuset: allow to keep tasks in empty cpusets

2013-06-05 Thread Li Zefan
efore calling update_task_nodemask() and update_task_cpumask(), instead of using workqueue. - add documentation in include/linux/cgroup.h Signed-off-by: Li Zefan --- include/linux/cgroup.h | 4 ++ kernel/cpuset.c| 137 + 2 files changed

[PATCH v2 10/10] cpuset: fix to migrate mm correctly in a corner case

2013-06-05 Thread Li Zefan
= ancestor's nodemask. so looks like no pages will be migrated. Fix this by: - Don't call update_tasks_nodemask() on empty cpusets. - Pass cs->old_mems_allowed to do_migrate_pages(). Signed-off-by: Li Zefan --- kernel/cpuset.c | 15 +++ 1 file changed, 11 insertions(+)

[PATCH v2 06/10] cpuset: record old_mems_allowed in struct cpuset

2013-06-05 Thread Li Zefan
s it by saving old mems_allowed in cpuset->old_mems_allowed. This currently won't change any behavior, but it will later allow us to keep tasks in empty cpusets. Signed-off-by: Li Zefan --- kernel/cpuset.c | 62 + 1 file cha

[PATCH v2 09/10] cpuset: allow to move tasks to empty cpusets

2013-06-05 Thread Li Zefan
n include/linux/cgroup.h Signed-off-by: Li Zefan --- include/linux/cgroup.h | 3 +++ kernel/cpuset.c| 12 +--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h index 53e81a6..74e8b8e 100644 --- a/include/linux/cgroup.h +++

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