[PATCH] CONNECTOR: don't touch queue dev after decrement of ref count

2008-01-08 Thread Li Zefan
cn_queue_free_callback() will touch 'dev'(i.e. cbq-pdev), so it should be called before atomic_dec(dev-refcnt). Signed-off-by: Li Zefan [EMAIL PROTECTED] --- drivers/connector/cn_queue.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/connector/cn_queue.c b

[PATCH][try #2] checkpatch: clear the report buffer after processing a file

2008-01-15 Thread Li Zefan
When checking multiple files, the report buffer is not cleared after processing a file, thus the report will be printed again and again, mixing up with other reports. Signed-off-by: Li Zefan [EMAIL PROTECTED] --- scripts/checkpatch.pl |6 +++--- 1 files changed, 3 insertions(+), 3

[PATCH] IA64 efi: make full use of macro efi_md_size

2007-11-11 Thread Li Zefan
Macro efi_md_size is defined in efi.c, and here we apply it throughout efi.c. Signed-off-by: Li Zefan [EMAIL PROTECTED] --- arch/ia64/kernel/efi.c | 10 +- 1 files changed, 5 insertions(+), 5 deletions(-) diff --git a/arch/ia64/kernel/efi.c b/arch/ia64/kernel/efi.c index 0e4ef20

[PATCH] HID: fix a potential bug in pointer casting

2007-11-14 Thread Li Zefan
; int i; }; but will fail if: struct foo { int i; struct list_head list; } Signed-off-by: Li Zefan [EMAIL PROTECTED] --- drivers/hid/usbhid/hid-tmff.c |7 --- 1 files changed, 4 insertions(+), 3 deletions(-) diff --git

Re: [PATCH] x86_64: fix a deadlock in set_rtc_mmss()

2007-11-15 Thread Li Zefan
); +spin_lock_irqsave(rtc_lock, flags); I think it's a good idea to update or just remove the comment above. David P. Reed has sent a patch to fix this bug before you. http://lkml.org/lkml/2007/11/14/435 Li Zefan - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body

Re: [PATCH 6/6] tick: add a missing dot in prink

2007-11-29 Thread Li Zefan
Frans Pop wrote: Li Zefan wrote: Add a missing '.' in prink information. -printk( no tick device\n); +printk( no tick device.\n); I wonder if that is correct. CodingStyle says: Chapter 13: Printing kernel messages [...] Kernel

Re: [PATCH 4/6] time: fix typo in comments

2007-11-29 Thread Li Zefan
-/* Suppose we want to devide two numbers NOM and DEN: NOM/DEN, the we can +/* Suppose we want to devide two numbers NOM and DEN: NOM/DEN, then we can divide Yes, I missed it. - * which, buy the way, it can do, but it take more code and at least 2 + * which, buy the way, it can do,

Re: Trailing periods in kernel messages

2007-11-29 Thread Li Zefan
Andrew Morton wrote: On Thu, 29 Nov 2007 11:20:18 +0100 Frans Pop [EMAIL PROTECTED] wrote: Well, for one it needlessly increases the size of log files. It also IMO just looks weird to have a trailing period only for some messages and it certainly is completely inappropriate for messages

Re: Trailing periods in kernel messages

2007-11-29 Thread Li Zefan
Joe Perches wrote: On Fri, 2007-11-30 at 09:12 +0800, Li Zefan wrote: Just a roughly grep: # grep -r -P --include=*.[ch] 'printk.*\.\\n' * | wc -l 6025 # grep -r -P --include=*.[ch] '\.\\n' * | wc -l 12723 Inequivalent. Try: grep -rP --include=*.[ch] 'printk.*\.\\n' * | wc -l

Re: [PATCH] kbuild: implement modules.order

2007-12-04 Thread Li Zefan
Tejun Heo wrote: WANG Cong wrote: I think, you forgot to free(3) the memory you calloc(3)'ed and malloc(3)'ed above. It's a simple program where whole body is in main(). Why bother? What's the benefit of adding hash-table iterating free logic? Personally, I think memory leaks are bugs. And

[PATCH 1/3] POWERPC: don't cast a pointer to pointer of list_head

2007-12-06 Thread Li Zefan
The casting is safe only when the list_head member is the first member of the structure. Signed-off-by: Li Zefan [EMAIL PROTECTED] --- arch/ppc/syslib/ocp.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/arch/ppc/syslib/ocp.c b/arch/ppc/syslib/ocp.c index 3f5be2c

[PATCH 2/3] DRM: don't cast a pointer to pointer of list_head

2007-12-06 Thread Li Zefan
The casting is safe only when the list_head member is the first member of the structure. Signed-off-by: Li Zefan [EMAIL PROTECTED] --- drivers/char/drm/i915_irq.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/char/drm/i915_irq.c b/drivers/char/drm/i915_irq.c

[PATCH 3/3] wireless/libertas: don't cast a pointer to pointer of list_head

2007-12-06 Thread Li Zefan
Don't cast struct foo * to struct list_head *, it's safe only when the list member is the first member of struct foo. Also don't cast struct list_head * to struct foo *. BTW: I'm not so sure where this patch should go to. Signed-off-by: Li Zefan [EMAIL PROTECTED] --- drivers/net/wireless

Re: [PATCH 1/3] POWERPC: don't cast a pointer to pointer of list_head

2007-12-06 Thread Li Zefan
Nick Piggin 写道: On Thursday 06 December 2007 20:33, Li Zefan wrote: The casting is safe only when the list_head member is the first member of the structure. Even so, I don't think too safe :) It might technically work, but it could break more easily. So even if you find places where

Re: Is there any word about this bug in gcc ?

2007-11-19 Thread Li Zefan
WANG Cong wrote: On Mon, Nov 19, 2007 at 09:10:44PM -0800, H. Peter Anvin wrote: WANG Cong wrote: On Tue, Nov 20, 2007 at 10:13:42AM +0800, zhengyi wrote: Is there any relevance to the kernel ? I found the folowing code here: http://linux.solidot.org/article.pl?sid=07/11/19/0512218from=rss

[PATCH 0/6] time: small fixes and code cleanups

2007-11-28 Thread Li Zefan
Those patches do some small fixes and code cleanups. No actual bug is fixed though. Li Zefan - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read

[PATCH 1/6] clocksource: remove redundant code

2007-11-28 Thread Li Zefan
Flag CLOCK_SOURCE_WATCHDOG is cleared twice. Note clocksource_change_rating() won't do anyting with the cs flag. Signed-off-by: Li Zefan [EMAIL PROTECTED] --- kernel/time/clocksource.c |1 - 1 files changed, 0 insertions(+), 1 deletions(-) diff --git a/kernel/time/clocksource.c b/kernel

[PATCH 2/6] clockevent: simplify list operations

2007-11-28 Thread Li Zefan
list_for_each_safe() suffices here. Signed-off-by: Li Zefan [EMAIL PROTECTED] --- kernel/time/clockevents.c | 11 --- 1 files changed, 4 insertions(+), 7 deletions(-) diff --git a/kernel/time/clockevents.c b/kernel/time/clockevents.c index 822beeb..68fbe73 100644 --- a/kernel/time

[PATCH 4/6] time: fix typo in comments

2007-11-28 Thread Li Zefan
Fix typo in comments. BTW: I have to fix coding style in arch/ia64/kernel/time.c also, otherwise checkpatch.pl will be complaining. Signed-off-by: Li Zefan [EMAIL PROTECTED] --- arch/ia64/kernel/time.c | 14 +++--- arch/x86/kernel/time_64.c |2 +- include/linux/hrtimer.h

[PATCH 5/6] time: delete comments that refer to noexistent symbols

2007-11-28 Thread Li Zefan
Function do_timer_interrupt_hook() don't take argument regs, and structure hrtimer_sleeper don't have member cb_pending. So delete comments refering to these symbols. Signed-off-by: Li Zefan [EMAIL PROTECTED] --- include/asm-x86/mach-voyager/do_timer.h |1 - include/linux/hrtimer.h

[PATCH 6/6] tick: add a missing dot in prink

2007-11-28 Thread Li Zefan
Add a missing '.' in prink information. Signed-off-by: Li Zefan [EMAIL PROTECTED] --- kernel/time/tick-oneshot.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/kernel/time/tick-oneshot.c b/kernel/time/tick-oneshot.c index 0258d31..0b5e513 100644 --- a/kernel/time

[PATCH 3/6] timekeeping: rename timekeeping_is_continuous to timekeeping_valid_for_hres

2007-11-28 Thread Li Zefan
Function timekeeping_is_continuous() no longer checks flag CLOCK_IS_CONTINUOUS, and it checks CLOCK_SOURCE_VALID_FOR_HRES now. So rename the function accordingly. Signed-off-by: Li Zefan [EMAIL PROTECTED] --- include/linux/time.h |2 +- kernel/time/tick-sched.c |2 +- kernel/time

[PATCH] checkpatch: clear the report buffer after processing a file

2008-01-03 Thread Li Zefan
When checking multiple files, the report buffer is not cleared after processing a file, thus the report will be printed again and again, mixing up with other reports. Signed-off-by: Li Zefan [EMAIL PROTECTED] --- scripts/checkpatch.pl |6 +++--- 1 files changed, 3 insertions(+), 3

[PATCH 1/5] CONNECTOR: add a missing break in cn_netlink_send()

2008-01-03 Thread Li Zefan
Each entry in the list has a unique id, so just break out of the loop if the matched id is found. Signed-off-by: Li Zefan [EMAIL PROTECTED] --- drivers/connector/connector.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/drivers/connector/connector.c b/drivers

[PATCH 2/5] CONNECTOR: clean up {,__}cn_rx_skb()

2008-01-03 Thread Li Zefan
, instead skb_free() is called. Signed-off-by: Li Zefan [EMAIL PROTECTED] --- drivers/connector/connector.c | 30 -- 1 files changed, 4 insertions(+), 26 deletions(-) diff --git a/drivers/connector/connector.c b/drivers/connector/connector.c index 6e70963..865303b

[PATCH 5/5] CONNECTOR: return proper error code in cn_call_callback()

2008-01-03 Thread Li Zefan
Error code should be set to EINVAL instead of ENODEV if !queue_work(). There's another call of queue_work() which may set err to EINVAL. Signed-off-by: Li Zefan [EMAIL PROTECTED] --- drivers/connector/connector.c |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/drivers

[PATCH] fix return value in ib_device_register_sysfs()

2008-02-14 Thread Li Zefan
Set ret to -ENOMEM when kobject_create_and_add() returns NULL. Signed-off-by: Li Zefan [EMAIL PROTECTED] --- drivers/infiniband/core/sysfs.c |4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/drivers/infiniband/core/sysfs.c b/drivers/infiniband/core/sysfs.c index

Re: [PATCH] fix return value in ib_device_register_sysfs()

2008-02-14 Thread Li Zefan
Roland Dreier wrote: Wow, good catch. How did you find this bug? Just by accident, when I glanced down the code. ;) Anyway, thanks, applied. - R. -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info

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

2012-10-08 Thread Li Zefan
...@andrew.cmu.edu Cc: Tejun Heo t...@kernel.org Cc: Li Zefan lize...@huawei.com Cc: sta...@vger.kernel.org # v3.0.x and later Signed-off-by: Daisuke Nishimura nishim...@mxp.nes.nec.co.jp --- This patch is based on v3.6. kernel/cgroup.c |3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff

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

2012-11-04 Thread Li Zefan
: Johannes Weiner han...@cmpxchg.org Cc: Balbir Singh bsinghar...@gmail.com Cc: KAMEZAWA Hiroyuki kamezawa.hir...@jp.fujitsu.com 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

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

2012-11-04 Thread Li Zefan
() removal dropped per Michal. Commit message updated to explain local_irq_disable/enable() conversion. Signed-off-by: Tejun Heo t...@kernel.org Reviewed-by: Michal Hocko mho...@suse.cz Acked-by: Li Zefan lize...@huawei.com -- To unsubscribe from this list: send the line unsubscribe linux

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

2012-11-04 Thread Li Zefan
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 t...@kernel.org Reviewed-by: Michal Hocko mho...@suse.cz Acked-by: Li Zefan lize...@huawei.com -- To unsubscribe from this list: send the line

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

2012-11-04 Thread Li Zefan
...@parallels.com 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://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
...@jp.fujitsu.com --- include/linux/cgroup.h | 21 - kernel/cgroup.c| 51 -- mm/memcontrol.c| 24 +--- 3 files changed, 1 insertion(+), 95 deletions(-) Acked-by: Li Zefan lize

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

2012-11-04 Thread Li Zefan
kamezawa.hir...@jp.fujitsu.com Cc: Vivek Goyal vgo...@redhat.com 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

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

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 for

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

2012-11-09 Thread Li Zefan
: Glauber Costa glom...@parallels.com 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 1/9 v3] cgroup: add cgroup_subsys-post_create()

2012-11-09 Thread Li Zefan
: Glauber Costa glom...@parallels.com 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 2/9] cgroup: Use rculist ops for cgroup-children

2012-11-09 Thread Li Zefan
. This isn't strictly necessary but is done so that the iteration order is more conventional. Signed-off-by: Tejun Heo t...@kernel.org 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

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

2012-11-09 Thread Li Zefan
on synchronization rules. Signed-off-by: Tejun Heo t...@kernel.org Reviewed-by: KAMEZAWA Hiroyuki kamezawa.hir...@jp.fujisu.com Reviewed-by: Michal Hocko mho...@suse.cz I don't see anything wrong with the comment on cgroup_next_descendant_pre(). Acked-by: Li Zefan lize...@huawei.com

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

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 back

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 event

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 conform to the current state

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); - ret

Re: [PATCH v4] net: cgroup: fix access the unallocated memory in netprio cgroup

2012-07-18 Thread Li Zefan
static struct cgroup_subsys_state *cgrp_create(struct cgroup *cgrp) { struct cgroup_netprio_state *cs; - int ret; + int ret = -EINVAL; cs = kzalloc(sizeof(*cs), GFP_KERNEL); if (!cs) return ERR_PTR(-ENOMEM); - if (cgrp-parent cgrp_netprio_state(cgrp-parent)-prioidx)

Re: [PATCH] hugetlb/cgroup: Simplify pre_destroy callback

2012-07-19 Thread Li Zefan
on 2012/7/19 10:55, Aneesh Kumar K.V wrote: Andrew Morton a...@linux-foundation.org writes: On Wed, 18 Jul 2012 11:04:09 +0530 Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com wrote: From: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com Since we cannot fail in

Re: [PATCH 3/4] cgroup: introduce sane_behavior mount option

2013-04-14 Thread Li Zefan
{ + .name = cgroup.sane_behavior, + .flags = CFTYPE_ONLY_ON_ROOT, + .read_seq_string = cgroup_sane_behavior_show, + .mode = S_IRUGO, + }, We don't have to set .mode explicitly. -- To unsubscribe from this list: send the line

Re: [PATCHSET] cgroup, memcg: introduce sane_behavior mount option

2013-04-14 Thread Li Zefan
-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://www.tux.org/lkml/

Re: [PATCH 4/4] cgroup: implement task_cgroup_path_from_hierarchy()

2013-04-14 Thread Li Zefan
+int task_cgroup_path_from_hierarchy(struct task_struct *task, int hierarchy_id, + char *buf, size_t buflen) +{ + struct cgroupfs_root *root; + struct cgroup *cgrp = NULL; + int ret = -ENOENT; + + mutex_lock(cgroup_mutex); + + root =

Re: [PATCHSET] cgroup: implement task_cgroup_path_from_hierarchy()

2013-04-14 Thread Li Zefan
-task_cgroup_path_from_hierarchy.patch 0001-0002 prepare for conversion to idr, which 0003 does. 0004 implements the new function. 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

Re: [PATCH 4/4] cgroup: implement task_cgroup_path_from_hierarchy()

2013-04-14 Thread Li Zefan
On 2013/4/15 11:46, Tejun Heo wrote: On Mon, Apr 15, 2013 at 11:43:15AM +0800, Li Zefan wrote: +int task_cgroup_path_from_hierarchy(struct task_struct *task, int hierarchy_id, + char *buf, size_t buflen) +{ + struct cgroupfs_root *root; + struct cgroup

[PATCH] cgroup: remove cgrp-top_cgroup

2013-04-15 Thread Li Zefan
It's not used, and it can be retrieved via cgrp-root-top_cgroup. Signed-off-by: Li Zefan lize...@huawei.com --- include/linux/cgroup.h | 1 - kernel/cgroup.c| 2 -- 2 files changed, 3 deletions(-) diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h index 9c300ad..64047ae 100644

Re: cgroup: status-quo and userland efforts

2013-04-16 Thread Li Zefan
On 2013/4/6 9:21, Tejun Heo wrote: Hello, guys. Status-quo == It's been about a year since I wrote up a summary on cgroup status quo and future plans. We're not there yet but much closer than we were before. At least the locking and object life-time management aren't crazy

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 which would affect all other co-mounted

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 dhowe...@redhat.com cc: Tejun Heo t...@kernel.org cc: Li Zefan lize...@huawei.com cc: contain...@lists.linux

[PATCH] cgroup: fix broken file xattrs

2013-04-18 Thread Li Zefan
the same struct simple_xattrs twice. Cc: sta...@vger.kernel.org # 3.8.x Reported-by: Alexey Kodanev alexey.koda...@oracle.com Signed-off-by: Li Zefan lize...@huawei.com --- 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

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

2013-04-19 Thread Li Zefan
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() cpuset: remove

[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 lize...@huawei.com --- 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

[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 lize...@huawei.com --- 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

[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 lize...@huawei.com --- kernel/cpuset.c | 29 +++-- 1 file changed, 7 insertions(+), 22 deletions(-) diff --git a/kernel/cpuset.c b/kernel/cpuset.c

[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 lize...@huawei.com --- 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

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

2013-04-19 Thread Li Zefan
-by: Li Zefan lize...@huawei.com --- 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

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

2013-04-19 Thread Li Zefan
*/ Without this patch, the last operation will fail. Signed-off-by: Li Zefan lize...@huawei.com --- 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
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 lize...@huawei.com --- kernel/cpuset.c | 62 + 1 file changed, 36

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

2013-04-19 Thread Li Zefan
cpusets. Signed-off-by: Li Zefan lize...@huawei.com --- 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

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

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

2013-04-19 Thread Li Zefan
: - 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 lize...@huawei.com

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' cpumask will just return failure and there's

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) +{ +struct cpuset *cp; +struct cgroup

Re: [RFC][PATCH 2/7] memcg: don't use mem_cgroup_get() when creating a kmemcg cache

2013-04-06 Thread Li Zefan
You are putting references but I do not see any single css_{try}get here. /me puzzled. There are two things being done in this code: First, we acquired a css_ref to make sure that the underlying cgroup would not go away. That is a short lived reference, and it is put as soon as the cache

Re: [PATCHSET] cgroup: unexport locking interface

2013-04-06 Thread Li Zefan
-cgroup_lock_is_held.patch 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://www.tux.org/lkml/

Re: [RFC][PATCH 0/7] memcg: make memcg's life cycle the same as cgroup

2013-04-07 Thread Li Zefan
On 2013/4/4 20:00, Michal Hocko wrote: On Wed 03-04-13 17:11:15, Li Zefan wrote: (I'll be off from my office soon, and I won't be responsive in the following 3 days.) I'm working on converting memcg to use cgroup-id, and then we can kill css_id. Now memcg has its own refcnt, so when

Re: [RFC][PATCH 0/7] memcg: make memcg's life cycle the same as cgroup

2013-04-07 Thread Li Zefan
that patch needs update (and can be simplified) after this patchset: - move memcg_dangling_add() to mem_cgroup_css_offline() - remove memcg-memcg_name, and use cgroup_path() in mem_cgroup_dangling_read()? On 2013/4/3 17:11, Li Zefan wrote: (I'll be off from my office soon, and I won't be responsive

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

2013-04-08 Thread Li Zefan
patch 13/12 is for the dangling memcg debugging patch. You'll see 2 small conflicts when you apply that debugging patch on top of this patchset. Just move memcg_dangling_add() to mem_cgroup_css_offline() and move memcg_dangling_free() to mem_cggroup_css_free(). Li Zefan (10): memcg: take

[PATCH 01/12] memcg: take reference before releasing rcu_read_lock

2013-04-08 Thread Li Zefan
The memcg is not referenced, so it can be destroyed at anytime right after we exit rcu read section, so it's not safe to access it. To fix this, we call css_tryget() to get a reference while we're still in rcu read section. Signed-off-by: Li Zefan lize...@huawei.com Acked-by: Glauber Costa glom

[PATCH 02/12] memcg: avoid accessing memcg after releasing reference

2013-04-08 Thread Li Zefan
This might cause use-after-free bug. Signed-off-by: Li Zefan lize...@huawei.com Acked-by: KAMEZAWA Hiroyuki kamezawa.hir...@jp.fujitsu.com Acked-by: Michal Hocko mho...@suse.cz --- mm/memcontrol.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/memcontrol.c b/mm

[PATCH 03/12] Revert memcg: avoid dangling reference count in creation failure.

2013-04-08 Thread Li Zefan
-off-by: Li Zefan lize...@huawei.com Signed-off-by: Michal Hocko mho...@suse.cz --- mm/memcontrol.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 2364f4e..44cec72 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -6250,8 +6250,6

[PATCH 04/12] memcg, kmem: fix reference count handling on the error path

2013-04-08 Thread Li Zefan
) but it doesn't take 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

[PATCH 05/12] memcg: use css_get() in sock_update_memcg()

2013-04-08 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 lize...@huawei.com Acked

[PATCH 06/12] memcg: don't use mem_cgroup_get() when creating a kmemcg cache

2013-04-08 Thread Li Zefan
css_put. (This changelog is basically written by Glauber) Signed-off-by: Li Zefan lize...@huawei.com Acked-by: Michal Hocko mho...@suse.cz --- mm/memcontrol.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/mm/memcontrol.c b/mm/memcontrol.c index bbf5bf3..c308ea0

[PATCH 07/12] memcg: use css_get/put when charging/uncharging kmem

2013-04-08 Thread Li Zefan
if kmem is activated in kmem_cgroup_css_offline() Signed-off-by: Li Zefan lize...@huawei.com --- mm/memcontrol.c | 66 +++-- 1 file changed, 41 insertions(+), 25 deletions(-) diff --git a/mm/memcontrol.c b/mm/memcontrol.c index c308ea0..7be796c

[PATCH 08/12] memcg: use css_get/put for swap memcg

2013-04-08 Thread Li Zefan
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 lize...@huawei.com Acked-by: Michal Hocko mho...@suse.cz Acked-by: KAMEZAWA Hiroyuki kamezawa.hir...@jp.fujitsu.com --- mm/memcontrol.c | 26

[PATCH 09/12] cgroup: make sure parent won't be destroyed before its children

2013-04-08 Thread Li Zefan
. Signed-off-by: Li Zefan lize...@huawei.com Reviewed-by: Michal Hocko mho...@suse.cz Acked-by: KAMEZAWA Hiroyuki kamezawa.hir...@jp.fujitsu.com --- kernel/cgroup.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/kernel/cgroup.c b/kernel/cgroup.c index 06aeb42..7ee3bdf 100644

[PATCH 10/12] memcg: don't need to get a reference to the parent

2013-04-08 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 lize...@huawei.com Acked-by: Michal Hocko mho...@suse.cz Acked

[PATCH 11/12] memcg: kill memcg refcnt

2013-04-08 Thread Li Zefan
Now memcg has the same life cycle as its corresponding cgroup. Kill the useless refcnt. Signed-off-by: Li Zefan lize...@huawei.com Acked-by: Michal Hocko mho...@suse.cz Acked-by: KAMEZAWA Hiroyuki kamezawa.hir...@jp.fujitsu.com --- mm/memcontrol.c | 18 +- 1 file changed, 1

[PATCH 13/12] memcg: don't need memcg-memcg_name

2013-04-08 Thread Li Zefan
Now memcg has the same life cycle as its corresponding cgroup, we don't have to save the cgroup path name in memcg-memcg_name. Signed-off-by: Li Zefan lize...@huawei.com --- mm/memcontrol.c | 65 + 1 file changed, 24 insertions(+), 41

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

2013-04-08 Thread Li Zefan
: free mem_cgroup by RCU to fix oops). Cc: Hugh Dickins hu...@google.com Signed-off-by: Li Zefan lize...@huawei.com --- mm/memcontrol.c | 51 +-- 1 file changed, 5 insertions(+), 46 deletions(-) diff --git a/mm/memcontrol.c b/mm/memcontrol.c index

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

2013-04-08 Thread Li Zefan
(This patchset depends on memcg: make memcg's life cycle the same as cgroup) This patchset converts memcg to always use cgroup-id, and then kills css_id. As we've removed memcg's own refcnt, converting memcg to use cgroup-id is very straight-forward. Li Zefan (8): cgroup: implement

[PATCH 1/8] cgroup: implement cgroup_is_ancestor()

2013-04-08 Thread Li Zefan
This will be used as a replacement for css_is_ancestor(). Signed-off-by: Li Zefan lize...@huawei.com --- include/linux/cgroup.h | 3 +++ kernel/cgroup.c| 21 + 2 files changed, 24 insertions(+) diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h index

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

2013-04-08 Thread Li Zefan
This is a preparation to kill css_id. Signed-off-by: Li Zefan lize...@huawei.com --- mm/memcontrol.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 14f1375..3561d0b 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -2769,15

[PATCH 3/8] memcg: convert to use cgroup_is_ancestor()

2013-04-08 Thread Li Zefan
This is a preparation to kill css_id. Signed-off-by: Li Zefan lize...@huawei.com --- mm/memcontrol.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 5aa6e91..14f1375 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -1383,7 +1383,7

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

2013-04-08 Thread Li Zefan
This is a preparation to kill css_id. Signed-off-by: Li Zefan lize...@huawei.com --- mm/memcontrol.c | 13 + 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 3561d0b..c4e0173 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c

[PATCH 2/8] cgroup: implement cgroup_from_id()

2013-04-08 Thread Li Zefan
This will be used as a replacement for css_lookup(). Signed-off-by: Li Zefan lize...@huawei.com --- include/linux/cgroup.h | 1 + kernel/cgroup.c| 31 +-- 2 files changed, 26 insertions(+), 6 deletions(-) diff --git a/include/linux/cgroup.h b/include/linux

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

2013-04-08 Thread Li Zefan
memcg requires the cgroup id to be smaller than 65536. Signed-off-by: Li Zefan lize...@huawei.com --- mm/memcontrol.c | 9 + 1 file changed, 9 insertions(+) diff --git a/mm/memcontrol.c b/mm/memcontrol.c index c4e0173..947dff1 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -492,6

[PATCH 7/8] memcg: don't use css_id any more

2013-04-08 Thread Li Zefan
Now memcg uses cgroup-id instead of css_id. Update some comments and set mem_cgroup_subsys-use_id to 0. Signed-off-by: Li Zefan lize...@huawei.com --- mm/memcontrol.c | 21 +++-- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/mm/memcontrol.c b/mm/memcontrol.c

[PATCH 8/8] cgroup: kill css_id

2013-04-08 Thread Li Zefan
The only user of css_id was memcg, and it has been converted to use cgroup-id, so kill css_id. Signed-off-by: Li Zefan lize...@huawei.com --- include/linux/cgroup.h | 38 kernel/cgroup.c| 258 - 2 files changed, 296 deletions

Re: [PATCH 13/12] memcg: don't need memcg-memcg_name

2013-04-08 Thread Li Zefan
On 2013/4/8 22:25, Michal Hocko wrote: On Mon 08-04-13 14:36:52, Li Zefan wrote: [...] @@ -5188,12 +5154,28 @@ static int mem_cgroup_dangling_read(struct cgroup *cont, struct cftype *cft, struct seq_file *m) { struct mem_cgroup *memcg; +char

Re: [PATCH v2 0/5] cpuacct, cgroup: Kill cgroup_subsys.active

2013-04-08 Thread Li Zefan
Hi Ingo, Any chance for this patchset and the other one to be queued for 3.10? Both of them has been acked by Peter. On 2013/3/29 18:36, Peter Zijlstra wrote: On Fri, 2013-03-29 at 14:43 +0800, Li Zefan wrote: cpuacct is the only user of cgroup_subsys.active flag. The flag is needed because

  1   2   3   4   5   6   7   8   9   10   >