Re: RIP: mem_cgroup_move_account+0xf4/0x290

2013-10-28 Thread Sha Zhengju
0001 R11: 0001 R12: >>> ea00103ef0c0 >>> [ 7691.367745] R13: 880424cd6000 R14: R15: >>> 880424cd622c >>> [ 7691.375738] FS: () GS:88043fc2() >>> knlGS: >>> [ 7

Re: RIP: mem_cgroup_move_account+0xf4/0x290

2013-10-28 Thread Sha Zhengju
01 7e [ 7691.528638] RIP [8119dcb4] mem_cgroup_move_account+0xf4/0x290 Add the required __this_cpu_read(). Sorry for my mistake and thanks for the fix up, it looks good to me. Reviewed-by: Sha Zhengju handai@taobao.com Thanks, Sha Signed-off-by: Johannes Weiner han

Re: [PATCH RFC] fsio: filesystem io accounting cgroup

2013-07-10 Thread Sha Zhengju
On Wed, Jul 10, 2013 at 2:03 PM, Konstantin Khlebnikov wrote: > Sha Zhengju wrote: >> >> Hi, >> >> On Mon, Jul 8, 2013 at 5:59 PM, Konstantin Khlebnikov >> wrote: >>> >>> > This is proof of concept, just basic functionality for IO contro

Re: [PATCH RFC] fsio: filesystem io accounting cgroup

2013-07-10 Thread Sha Zhengju
On Wed, Jul 10, 2013 at 2:03 PM, Konstantin Khlebnikov khlebni...@openvz.org wrote: Sha Zhengju wrote: Hi, On Mon, Jul 8, 2013 at 5:59 PM, Konstantin Khlebnikov khlebni...@openvz.org wrote: This is proof of concept, just basic functionality for IO controller. This cgroup will control

Re: [PATCH RFC] fsio: filesystem io accounting cgroup

2013-07-09 Thread Sha Zhengju
writeback: get rid of account_size argument in > cancel_dirty_page() > c575ef6 hugetlbfs: remove cancel_dirty_page() from truncate_huge_page() > b720923 nfs: remove redundant cancel_dirty_page() from nfs_wb_page_cancel() > 4c21e52 mm: remove redundant dirty pages check from __delete_f

Re: [PATCH RFC] fsio: filesystem io accounting cgroup

2013-07-09 Thread Sha Zhengju
cancel_dirty_page() from nfs_wb_page_cancel() 4c21e52 mm: remove redundant dirty pages check from __delete_from_page_cache() Signed-off-by: Konstantin Khlebnikov khlebni...@openvz.org Cc: cgro...@vger.kernel.org Cc: de...@openvz.org Cc: Michal Hocko mho...@suse.cz Cc: Sha Zhengju handai@gmail.com

Re: [PATCH V3 4/8] memcg: add per cgroup dirty pages accounting

2013-05-03 Thread Sha Zhengju
On Fri, May 3, 2013 at 5:11 PM, Michal Hocko wrote: > On Wed 02-01-13 11:44:21, Michal Hocko wrote: >> On Wed 26-12-12 01:26:07, Sha Zhengju wrote: >> > From: Sha Zhengju >> > >> > This patch adds memcg routines to count dirty pages, which allows memo

Re: [PATCH V3 4/8] memcg: add per cgroup dirty pages accounting

2013-05-03 Thread Sha Zhengju
On Fri, May 3, 2013 at 5:11 PM, Michal Hocko mho...@suse.cz wrote: On Wed 02-01-13 11:44:21, Michal Hocko wrote: On Wed 26-12-12 01:26:07, Sha Zhengju wrote: From: Sha Zhengju handai@taobao.com This patch adds memcg routines to count dirty pages, which allows memory controller

[tip:sched/urgent] sched/core: Remove the obsolete and unused nr_uninterruptible() function

2013-02-20 Thread tip-bot for Sha Zhengju
Commit-ID: 1c3e826482ab698e418c7a894440e62c76aac893 Gitweb: http://git.kernel.org/tip/1c3e826482ab698e418c7a894440e62c76aac893 Author: Sha Zhengju AuthorDate: Wed, 20 Feb 2013 17:14:38 +0800 Committer: Ingo Molnar CommitDate: Wed, 20 Feb 2013 11:39:24 +0100 sched/core: Remove

[PATCH V3] sched/core: remove obsolete nr_uninterruptible()

2013-02-20 Thread Sha Zhengju
From: Sha Zhengju Signed-off-by: Sha Zhengju --- include/linux/sched.h |1 - kernel/sched/core.c | 22 ++ 2 files changed, 2 insertions(+), 21 deletions(-) diff --git a/include/linux/sched.h b/include/linux/sched.h index 33cc421..f9ca237d 100644 --- a/include/linux

Re: [PATCH] sched/core: remove obsolete nr_uninterruptible()

2013-02-20 Thread Sha Zhengju
On Wed, Feb 20, 2013 at 4:31 PM, Xiaotian Feng wrote: > On Wed, Feb 20, 2013 at 3:37 PM, Sha Zhengju wrote: >> From: Sha Zhengju >> >> Signed-off-by: Sha Zhengju >> --- >> kernel/sched/core.c | 17 - >> 1 file changed, 17 deletions(

[PATCH V2] sched/core: remove obsolete nr_uninterruptible()

2013-02-20 Thread Sha Zhengju
From: Sha Zhengju Signed-off-by: Sha Zhengju --- kernel/sched/core.c | 22 ++ 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 03d7784..b7b03cd 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c

[PATCH V2] sched/core: remove obsolete nr_uninterruptible()

2013-02-20 Thread Sha Zhengju
From: Sha Zhengju handai@taobao.com Signed-off-by: Sha Zhengju handai@taobao.com --- kernel/sched/core.c | 22 ++ 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 03d7784..b7b03cd 100644 --- a/kernel

Re: [PATCH] sched/core: remove obsolete nr_uninterruptible()

2013-02-20 Thread Sha Zhengju
On Wed, Feb 20, 2013 at 4:31 PM, Xiaotian Feng xtf...@gmail.com wrote: On Wed, Feb 20, 2013 at 3:37 PM, Sha Zhengju handai@gmail.com wrote: From: Sha Zhengju handai@taobao.com Signed-off-by: Sha Zhengju handai@taobao.com --- kernel/sched/core.c | 17 - 1 file

[PATCH V3] sched/core: remove obsolete nr_uninterruptible()

2013-02-20 Thread Sha Zhengju
From: Sha Zhengju handai@taobao.com Signed-off-by: Sha Zhengju handai@taobao.com --- include/linux/sched.h |1 - kernel/sched/core.c | 22 ++ 2 files changed, 2 insertions(+), 21 deletions(-) diff --git a/include/linux/sched.h b/include/linux/sched.h index

[tip:sched/urgent] sched/core: Remove the obsolete and unused nr_uninterruptible() function

2013-02-20 Thread tip-bot for Sha Zhengju
Commit-ID: 1c3e826482ab698e418c7a894440e62c76aac893 Gitweb: http://git.kernel.org/tip/1c3e826482ab698e418c7a894440e62c76aac893 Author: Sha Zhengju handai@taobao.com AuthorDate: Wed, 20 Feb 2013 17:14:38 +0800 Committer: Ingo Molnar mi...@kernel.org CommitDate: Wed, 20 Feb 2013 11:39

[PATCH] sched/core: remove obsolete nr_uninterruptible()

2013-02-19 Thread Sha Zhengju
From: Sha Zhengju Signed-off-by: Sha Zhengju --- kernel/sched/core.c | 17 - 1 file changed, 17 deletions(-) diff --git a/kernel/sched/core.c b/kernel/sched/core.c index c0b07c3..792f6fc 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -1957,23 +1957,6

[PATCH] sched/core: remove obsolete nr_uninterruptible()

2013-02-19 Thread Sha Zhengju
From: Sha Zhengju handai@taobao.com Signed-off-by: Sha Zhengju handai@taobao.com --- kernel/sched/core.c | 17 - 1 file changed, 17 deletions(-) diff --git a/kernel/sched/core.c b/kernel/sched/core.c index c0b07c3..792f6fc 100644 --- a/kernel/sched/core.c +++ b/kernel

Re: [PATCH v5 03/11] cgroup, sched: let cpu serve the same files as cpuacct

2013-01-15 Thread Sha Zhengju
On Mon, Jan 14, 2013 at 10:55 PM, Glauber Costa wrote: > On 01/14/2013 12:34 AM, Sha Zhengju wrote: >>> + struct kernel_cpustat *kcpustat = this_cpu_ptr(ca->cpustat); >>> > + >>> > kcpustat = this_cpu_ptr(ca->cpu

Re: [PATCH v5 03/11] cgroup, sched: let cpu serve the same files as cpuacct

2013-01-15 Thread Sha Zhengju
On Mon, Jan 14, 2013 at 10:55 PM, Glauber Costa glom...@parallels.com wrote: On 01/14/2013 12:34 AM, Sha Zhengju wrote: + struct kernel_cpustat *kcpustat = this_cpu_ptr(ca-cpustat); + kcpustat = this_cpu_ptr(ca-cpustat); Is this reassignment unnecessary

Re: [PATCH v5 03/11] cgroup, sched: let cpu serve the same files as cpuacct

2013-01-14 Thread Sha Zhengju
On Wed, Jan 9, 2013 at 7:45 PM, Glauber Costa wrote: > From: Tejun Heo > > cpuacct being on a separate hierarchy is one of the main cgroup > related complaints from scheduler side and the consensus seems to be > > * Allowing cpuacct to be a separate controller was a mistake. In > general

Re: [PATCH v5 03/11] cgroup, sched: let cpu serve the same files as cpuacct

2013-01-14 Thread Sha Zhengju
On Wed, Jan 9, 2013 at 7:45 PM, Glauber Costa glom...@parallels.com wrote: From: Tejun Heo t...@kernel.org cpuacct being on a separate hierarchy is one of the main cgroup related complaints from scheduler side and the consensus seems to be * Allowing cpuacct to be a separate controller was a

Re: [PATCH] memcg: modify swap accounting function to support THP

2013-01-10 Thread Sha Zhengju
On Thu, Jan 10, 2013 at 9:39 PM, Michal Hocko wrote: > On Thu 10-01-13 19:43:58, Sha Zhengju wrote: >> From: Sha Zhengju > > THP are not swapped out because they are split before so this change > doesn't make much sense to me. Yes... I have been pu

[PATCH] memcg: modify swap accounting function to support THP

2013-01-10 Thread Sha Zhengju
From: Sha Zhengju Signed-off-by: Sha Zhengju --- mm/memcontrol.c | 13 ++--- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 3817460..674cf21 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -914,10 +914,9 @@ static long

Re: [PATCH V3 4/8] memcg: add per cgroup dirty pages accounting

2013-01-10 Thread Sha Zhengju
On Thu, Jan 10, 2013 at 1:03 PM, Kamezawa Hiroyuki wrote: > (2013/01/10 13:26), Sha Zhengju wrote: > >> But this method also has its pros and cons(e.g. need lock nesting). So >> I doubt whether the following is able to deal with these issues all >> together: >> (CP

Re: [PATCH] memcg: modify swap accounting function to support THP

2013-01-10 Thread Sha Zhengju
On Thu, Jan 10, 2013 at 9:39 PM, Michal Hocko mho...@suse.cz wrote: On Thu 10-01-13 19:43:58, Sha Zhengju wrote: From: Sha Zhengju handai@taobao.com THP are not swapped out because they are split before so this change doesn't make much sense to me. Yes... I have been puzzled by 'nr_pages

Re: [PATCH V3 4/8] memcg: add per cgroup dirty pages accounting

2013-01-10 Thread Sha Zhengju
On Thu, Jan 10, 2013 at 1:03 PM, Kamezawa Hiroyuki kamezawa.hir...@jp.fujitsu.com wrote: (2013/01/10 13:26), Sha Zhengju wrote: But this method also has its pros and cons(e.g. need lock nesting). So I doubt whether the following is able to deal with these issues all together: (CPU-A does

[PATCH] memcg: modify swap accounting function to support THP

2013-01-10 Thread Sha Zhengju
From: Sha Zhengju handai@taobao.com Signed-off-by: Sha Zhengju handai@taobao.com --- mm/memcontrol.c | 13 ++--- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 3817460..674cf21 100644 --- a/mm/memcontrol.c +++ b/mm

Re: [PATCH V3 4/8] memcg: add per cgroup dirty pages accounting

2013-01-09 Thread Sha Zhengju
On Thu, Jan 10, 2013 at 10:16 AM, Kamezawa Hiroyuki wrote: > (2013/01/10 0:02), Sha Zhengju wrote: >> >> On Mon, Jan 7, 2013 at 3:25 PM, Kamezawa Hiroyuki >> wrote: >>> >>> (2013/01/05 13:48), Sha Zhengju wrote: >>>> >>&g

Re: [PATCH V3 4/8] memcg: add per cgroup dirty pages accounting

2013-01-09 Thread Sha Zhengju
On Mon, Jan 7, 2013 at 3:25 PM, Kamezawa Hiroyuki wrote: > (2013/01/05 13:48), Sha Zhengju wrote: >> >> On Wed, Jan 2, 2013 at 6:44 PM, Michal Hocko wrote: >>> >>> On Wed 26-12-12 01:26:07, Sha Zhengju wrote: >>>> >>>> From: Sha Zhengju

Re: [PATCH V3 4/8] memcg: add per cgroup dirty pages accounting

2013-01-09 Thread Sha Zhengju
Hi Hugh, On Mon, Jan 7, 2013 at 4:02 AM, Hugh Dickins wrote: > On Sat, 5 Jan 2013, Sha Zhengju wrote: >> On Wed, Jan 2, 2013 at 6:44 PM, Michal Hocko wrote: >> > >> > Maybe I have missed some other locking which would prevent this from >> > happening

Re: [PATCH V3 4/8] memcg: add per cgroup dirty pages accounting

2013-01-09 Thread Sha Zhengju
On Mon, Jan 7, 2013 at 4:07 AM, Greg Thelen wrote: > On Tue, Dec 25 2012, Sha Zhengju wrote: > >> From: Sha Zhengju >> >> This patch adds memcg routines to count dirty pages, which allows memory >> controller >> to maintain an accurate view of the amount of

Re: [PATCH V3 5/8] memcg: add per cgroup writeback pages accounting

2013-01-09 Thread Sha Zhengju
On Mon, Jan 7, 2013 at 4:07 AM, Greg Thelen wrote: > On Tue, Dec 25 2012, Sha Zhengju wrote: > >> From: Sha Zhengju >> >> Similar to dirty page, we add per cgroup writeback pages accounting. The lock >> rule still is: >> mem_cgroup_begin_updat

Re: [PATCH V3 5/8] memcg: add per cgroup writeback pages accounting

2013-01-09 Thread Sha Zhengju
On Mon, Jan 7, 2013 at 4:07 AM, Greg Thelen gthe...@google.com wrote: On Tue, Dec 25 2012, Sha Zhengju wrote: From: Sha Zhengju handai@taobao.com Similar to dirty page, we add per cgroup writeback pages accounting. The lock rule still is: mem_cgroup_begin_update_page_stat

Re: [PATCH V3 4/8] memcg: add per cgroup dirty pages accounting

2013-01-09 Thread Sha Zhengju
On Mon, Jan 7, 2013 at 4:07 AM, Greg Thelen gthe...@google.com wrote: On Tue, Dec 25 2012, Sha Zhengju wrote: From: Sha Zhengju handai@taobao.com This patch adds memcg routines to count dirty pages, which allows memory controller to maintain an accurate view of the amount of its dirty

Re: [PATCH V3 4/8] memcg: add per cgroup dirty pages accounting

2013-01-09 Thread Sha Zhengju
Hi Hugh, On Mon, Jan 7, 2013 at 4:02 AM, Hugh Dickins hu...@google.com wrote: On Sat, 5 Jan 2013, Sha Zhengju wrote: On Wed, Jan 2, 2013 at 6:44 PM, Michal Hocko mho...@suse.cz wrote: Maybe I have missed some other locking which would prevent this from happening but the locking relations

Re: [PATCH V3 4/8] memcg: add per cgroup dirty pages accounting

2013-01-09 Thread Sha Zhengju
On Mon, Jan 7, 2013 at 3:25 PM, Kamezawa Hiroyuki kamezawa.hir...@jp.fujitsu.com wrote: (2013/01/05 13:48), Sha Zhengju wrote: On Wed, Jan 2, 2013 at 6:44 PM, Michal Hocko mho...@suse.cz wrote: On Wed 26-12-12 01:26:07, Sha Zhengju wrote: From: Sha Zhengju handai@taobao.com This patch

Re: [PATCH V3 4/8] memcg: add per cgroup dirty pages accounting

2013-01-09 Thread Sha Zhengju
On Thu, Jan 10, 2013 at 10:16 AM, Kamezawa Hiroyuki kamezawa.hir...@jp.fujitsu.com wrote: (2013/01/10 0:02), Sha Zhengju wrote: On Mon, Jan 7, 2013 at 3:25 PM, Kamezawa Hiroyuki kamezawa.hir...@jp.fujitsu.com wrote: (2013/01/05 13:48), Sha Zhengju wrote: On Wed, Jan 2, 2013 at 6:44 PM

Re: [PATCH V3 8/8] memcg: Document cgroup dirty/writeback memory statistics

2013-01-05 Thread Sha Zhengju
On Fri, Dec 28, 2012 at 9:10 AM, Kamezawa Hiroyuki wrote: > (2012/12/26 2:28), Sha Zhengju wrote: >> From: Sha Zhengju >> >> Signed-off-by: Sha Zhengju > > I don't think your words are bad but it may be better to sync with meminfo's > text. > >> --- >&

Re: [PATCH V3 7/8] memcg: disable memcg page stat accounting code when not in use

2013-01-05 Thread Sha Zhengju
On Fri, Dec 28, 2012 at 9:45 AM, Kamezawa Hiroyuki wrote: > (2012/12/26 2:27), Sha Zhengju wrote: >> From: Sha Zhengju >> >> It's inspired by a similar optimization from Glauber Costa >> (memcg: make it suck faster; https://lkml.org/lkml/2012/9/25/154). >>

Re: [PATCH V3 6/8] memcg: Don't account root_mem_cgroup page statistics

2013-01-05 Thread Sha Zhengju
On Wed, Jan 2, 2013 at 8:27 PM, Michal Hocko wrote: > On Wed 26-12-12 01:27:27, Sha Zhengju wrote: >> From: Sha Zhengju >> >> If memcg is enabled and no non-root memcg exists, all allocated pages >> belongs to root_mem_cgroup and go through root memcg statistics ro

Re: [PATCH V3 6/8] memcg: Don't account root_mem_cgroup page statistics

2013-01-05 Thread Sha Zhengju
On Wed, Jan 2, 2013 at 8:27 PM, Michal Hocko mho...@suse.cz wrote: On Wed 26-12-12 01:27:27, Sha Zhengju wrote: From: Sha Zhengju handai@taobao.com If memcg is enabled and no non-root memcg exists, all allocated pages belongs to root_mem_cgroup and go through root memcg statistics

Re: [PATCH V3 7/8] memcg: disable memcg page stat accounting code when not in use

2013-01-05 Thread Sha Zhengju
On Fri, Dec 28, 2012 at 9:45 AM, Kamezawa Hiroyuki kamezawa.hir...@jp.fujitsu.com wrote: (2012/12/26 2:27), Sha Zhengju wrote: From: Sha Zhengju handai@taobao.com It's inspired by a similar optimization from Glauber Costa (memcg: make it suck faster; https://lkml.org/lkml/2012/9/25/154

Re: [PATCH V3 8/8] memcg: Document cgroup dirty/writeback memory statistics

2013-01-05 Thread Sha Zhengju
On Fri, Dec 28, 2012 at 9:10 AM, Kamezawa Hiroyuki kamezawa.hir...@jp.fujitsu.com wrote: (2012/12/26 2:28), Sha Zhengju wrote: From: Sha Zhengju handai@taobao.com Signed-off-by: Sha Zhengju handai@taobao.com I don't think your words are bad but it may be better to sync with meminfo's

Re: [PATCH V3 6/8] memcg: Don't account root_mem_cgroup page statistics

2013-01-04 Thread Sha Zhengju
On Fri, Dec 28, 2012 at 9:04 AM, Kamezawa Hiroyuki wrote: > (2012/12/26 2:27), Sha Zhengju wrote: >> From: Sha Zhengju >> >> If memcg is enabled and no non-root memcg exists, all allocated pages >> belongs to root_mem_cgroup and go through root memcg statistics ro

Re: [PATCH V3 4/8] memcg: add per cgroup dirty pages accounting

2013-01-04 Thread Sha Zhengju
On Wed, Jan 2, 2013 at 6:44 PM, Michal Hocko wrote: > On Wed 26-12-12 01:26:07, Sha Zhengju wrote: >> From: Sha Zhengju >> >> This patch adds memcg routines to count dirty pages, which allows memory >> controller >> to maintain an accurate view of the a

Re: [PATCH V3 2/8] Make TestSetPageDirty and dirty page accounting in one func

2013-01-04 Thread Sha Zhengju
Hi Michal, Sorry for my late response, I'm just back from vocation. : ) On Wed, Jan 2, 2013 at 5:08 PM, Michal Hocko wrote: > On Wed 26-12-12 01:22:36, Sha Zhengju wrote: >> From: Sha Zhengju >> >> Commit a8e7d49a(Fix race in create_empty_buffers() vs >&g

Re: [PATCH V3 2/8] Make TestSetPageDirty and dirty page accounting in one func

2013-01-04 Thread Sha Zhengju
Hi Kame, Sorry for the late response, I'm just back from vocation. : ) On Fri, Dec 28, 2012 at 8:39 AM, Kamezawa Hiroyuki wrote: > (2012/12/26 2:22), Sha Zhengju wrote: >> From: Sha Zhengju >> >> Commit a8e7d49a(Fix race in create_empty_buffers() vs >> __set_page_d

Re: [PATCH V3 2/8] Make TestSetPageDirty and dirty page accounting in one func

2013-01-04 Thread Sha Zhengju
Hi Kame, Sorry for the late response, I'm just back from vocation. : ) On Fri, Dec 28, 2012 at 8:39 AM, Kamezawa Hiroyuki kamezawa.hir...@jp.fujitsu.com wrote: (2012/12/26 2:22), Sha Zhengju wrote: From: Sha Zhengju handai@taobao.com Commit a8e7d49a(Fix race in create_empty_buffers() vs

Re: [PATCH V3 2/8] Make TestSetPageDirty and dirty page accounting in one func

2013-01-04 Thread Sha Zhengju
Hi Michal, Sorry for my late response, I'm just back from vocation. : ) On Wed, Jan 2, 2013 at 5:08 PM, Michal Hocko mho...@suse.cz wrote: On Wed 26-12-12 01:22:36, Sha Zhengju wrote: From: Sha Zhengju handai@taobao.com Commit a8e7d49a(Fix race in create_empty_buffers() vs

Re: [PATCH V3 4/8] memcg: add per cgroup dirty pages accounting

2013-01-04 Thread Sha Zhengju
On Wed, Jan 2, 2013 at 6:44 PM, Michal Hocko mho...@suse.cz wrote: On Wed 26-12-12 01:26:07, Sha Zhengju wrote: From: Sha Zhengju handai@taobao.com This patch adds memcg routines to count dirty pages, which allows memory controller to maintain an accurate view of the amount of its dirty

Re: [PATCH V3 6/8] memcg: Don't account root_mem_cgroup page statistics

2013-01-04 Thread Sha Zhengju
On Fri, Dec 28, 2012 at 9:04 AM, Kamezawa Hiroyuki kamezawa.hir...@jp.fujitsu.com wrote: (2012/12/26 2:27), Sha Zhengju wrote: From: Sha Zhengju handai@taobao.com If memcg is enabled and no non-root memcg exists, all allocated pages belongs to root_mem_cgroup and go through root memcg

[PATCH V3 6/8] memcg: Don't account root_mem_cgroup page statistics

2012-12-25 Thread Sha Zhengju
From: Sha Zhengju If memcg is enabled and no non-root memcg exists, all allocated pages belongs to root_mem_cgroup and go through root memcg statistics routines which brings some overheads. So for the sake of performance, we can give up accounting stats of root memcg

[PATCH V3 5/8] memcg: add per cgroup writeback pages accounting

2012-12-25 Thread Sha Zhengju
From: Sha Zhengju Similar to dirty page, we add per cgroup writeback pages accounting. The lock rule still is: mem_cgroup_begin_update_page_stat() modify page WRITEBACK stat mem_cgroup_update_page_stat() mem_cgroup_end_update_page_stat() There're two writeback

[PATCH V3 8/8] memcg: Document cgroup dirty/writeback memory statistics

2012-12-25 Thread Sha Zhengju
From: Sha Zhengju Signed-off-by: Sha Zhengju --- Documentation/cgroups/memory.txt |2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/cgroups/memory.txt b/Documentation/cgroups/memory.txt index addb1f1..2828164 100644 --- a/Documentation/cgroups/memory.txt +++ b

[PATCH V3 7/8] memcg: disable memcg page stat accounting code when not in use

2012-12-25 Thread Sha Zhengju
From: Sha Zhengju It's inspired by a similar optimization from Glauber Costa (memcg: make it suck faster; https://lkml.org/lkml/2012/9/25/154). Here we use jump label to patch the memcg page stat accounting code in or out when not used. when the first non-root memcg comes to life the code

[PATCH V3 1/8] memcg: remove MEMCG_NR_FILE_MAPPED

2012-12-25 Thread Sha Zhengju
From: Sha Zhengju While accounting memcg page stat, it's not worth to use MEMCG_NR_FILE_MAPPED as an extra layer of indirection because of the complexity and presumed performance overhead. We can use MEM_CGROUP_STAT_FILE_MAPPED directly. Signed-off-by: Sha Zhengju Acked-by: KAMEZAWA Hiroyuki

[PATCH V3 4/8] memcg: add per cgroup dirty pages accounting

2012-12-25 Thread Sha Zhengju
From: Sha Zhengju This patch adds memcg routines to count dirty pages, which allows memory controller to maintain an accurate view of the amount of its dirty memory and can provide some info for users while cgroup's direct reclaim is working. After Kame's commit 89c06bd5(memcg: use new logic

[PATCH V3 3/8] use vfs __set_page_dirty interface instead of doing it inside filesystem

2012-12-25 Thread Sha Zhengju
From: Sha Zhengju Following we will treat SetPageDirty and dirty page accounting as an integrated operation. Filesystems had better use vfs interface directly to avoid those details. Signed-off-by: Sha Zhengju Acked-by: Sage Weil --- fs/buffer.c |3 ++- fs/ceph/addr.c

[PATCH V3 2/8] Make TestSetPageDirty and dirty page accounting in one func

2012-12-25 Thread Sha Zhengju
From: Sha Zhengju Commit a8e7d49a(Fix race in create_empty_buffers() vs __set_page_dirty_buffers()) extracts TestSetPageDirty from __set_page_dirty and is far away from account_page_dirtied. But it's better to make the two operations in one single function to keep modular. So in order to avoid

[PATCH V3 0/8] Per-cgroup page stat accounting

2012-12-25 Thread Sha Zhengju
comed. : ) Change log: v3 <--v2 1. change lock order of mapping->tree_lock and memcg->move_lock 2. performance optimization in 6/8 and 7/8 v2 <-- v1: 1. add test numbers 2. some small fix and comments Sha Zhengju (8): memcg-remove-MEMCG_NR_FILE_MAPP

[PATCH V3 0/8] Per-cgroup page stat accounting

2012-12-25 Thread Sha Zhengju
1. change lock order of mapping-tree_lock and memcg-move_lock 2. performance optimization in 6/8 and 7/8 v2 -- v1: 1. add test numbers 2. some small fix and comments Sha Zhengju (8): memcg-remove-MEMCG_NR_FILE_MAPPED.patch Make-TestSetPageDirty-and-dirty

[PATCH V3 2/8] Make TestSetPageDirty and dirty page accounting in one func

2012-12-25 Thread Sha Zhengju
From: Sha Zhengju handai@taobao.com Commit a8e7d49a(Fix race in create_empty_buffers() vs __set_page_dirty_buffers()) extracts TestSetPageDirty from __set_page_dirty and is far away from account_page_dirtied. But it's better to make the two operations in one single function to keep modular

[PATCH V3 3/8] use vfs __set_page_dirty interface instead of doing it inside filesystem

2012-12-25 Thread Sha Zhengju
From: Sha Zhengju handai@taobao.com Following we will treat SetPageDirty and dirty page accounting as an integrated operation. Filesystems had better use vfs interface directly to avoid those details. Signed-off-by: Sha Zhengju handai@taobao.com Acked-by: Sage Weil s...@inktank.com

[PATCH V3 4/8] memcg: add per cgroup dirty pages accounting

2012-12-25 Thread Sha Zhengju
From: Sha Zhengju handai@taobao.com This patch adds memcg routines to count dirty pages, which allows memory controller to maintain an accurate view of the amount of its dirty memory and can provide some info for users while cgroup's direct reclaim is working. After Kame's commit 89c06bd5

[PATCH V3 1/8] memcg: remove MEMCG_NR_FILE_MAPPED

2012-12-25 Thread Sha Zhengju
From: Sha Zhengju handai@taobao.com While accounting memcg page stat, it's not worth to use MEMCG_NR_FILE_MAPPED as an extra layer of indirection because of the complexity and presumed performance overhead. We can use MEM_CGROUP_STAT_FILE_MAPPED directly. Signed-off-by: Sha Zhengju handai

[PATCH V3 7/8] memcg: disable memcg page stat accounting code when not in use

2012-12-25 Thread Sha Zhengju
From: Sha Zhengju handai@taobao.com It's inspired by a similar optimization from Glauber Costa (memcg: make it suck faster; https://lkml.org/lkml/2012/9/25/154). Here we use jump label to patch the memcg page stat accounting code in or out when not used. when the first non-root memcg comes

[PATCH V3 8/8] memcg: Document cgroup dirty/writeback memory statistics

2012-12-25 Thread Sha Zhengju
From: Sha Zhengju handai@taobao.com Signed-off-by: Sha Zhengju handai@taobao.com --- Documentation/cgroups/memory.txt |2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/cgroups/memory.txt b/Documentation/cgroups/memory.txt index addb1f1..2828164 100644

[PATCH V3 5/8] memcg: add per cgroup writeback pages accounting

2012-12-25 Thread Sha Zhengju
From: Sha Zhengju handai@taobao.com Similar to dirty page, we add per cgroup writeback pages accounting. The lock rule still is: mem_cgroup_begin_update_page_stat() modify page WRITEBACK stat mem_cgroup_update_page_stat() mem_cgroup_end_update_page_stat

[PATCH V3 6/8] memcg: Don't account root_mem_cgroup page statistics

2012-12-25 Thread Sha Zhengju
From: Sha Zhengju handai@taobao.com If memcg is enabled and no non-root memcg exists, all allocated pages belongs to root_mem_cgroup and go through root memcg statistics routines which brings some overheads. So for the sake of performance, we can give up accounting stats of root memcg

Re: [PATCH V3] memcg, oom: provide more precise dump info while memcg oom happening

2012-11-09 Thread Sha Zhengju
On 11/09/2012 06:50 PM, Michal Hocko wrote: On Fri 09-11-12 18:23:07, Sha Zhengju wrote: On 11/09/2012 12:25 AM, Michal Hocko wrote: On Thu 08-11-12 23:52:47, Sha Zhengju wrote: [...] + for (i = 0; i< MEM_CGROUP_STAT_NSTATS; i++) { + long long val

Re: [PATCH V3] memcg, oom: provide more precise dump info while memcg oom happening

2012-11-09 Thread Sha Zhengju
On 11/09/2012 04:12 PM, Kamezawa Hiroyuki wrote: > (2012/11/09 0:52), Sha Zhengju wrote: >> From: Sha Zhengju >> >> Current when a memcg oom is happening the oom dump messages is still global >> state and provides few useful info for users. This patch prints more point

Re: [PATCH V3] memcg, oom: provide more precise dump info while memcg oom happening

2012-11-09 Thread Sha Zhengju
On 11/09/2012 12:25 AM, Michal Hocko wrote: On Thu 08-11-12 23:52:47, Sha Zhengju wrote: [...] (2) After change [ 269.225628] mal invoked oom-killer: gfp_mask=0xd0, order=0, oom_score_adj=0 [ 269.225633] mal cpuset=/ mems_allowed=0-1 [ 269.225636] Pid: 4616, comm: mal Not tainted 3.6.0+ #25

Re: [PATCH V3] memcg, oom: provide more precise dump info while memcg oom happening

2012-11-09 Thread Sha Zhengju
On 11/09/2012 12:25 AM, Michal Hocko wrote: On Thu 08-11-12 23:52:47, Sha Zhengju wrote: [...] (2) After change [ 269.225628] mal invoked oom-killer: gfp_mask=0xd0, order=0, oom_score_adj=0 [ 269.225633] mal cpuset=/ mems_allowed=0-1 [ 269.225636] Pid: 4616, comm: mal Not tainted 3.6.0+ #25

Re: [PATCH V3] memcg, oom: provide more precise dump info while memcg oom happening

2012-11-09 Thread Sha Zhengju
On 11/09/2012 04:12 PM, Kamezawa Hiroyuki wrote: (2012/11/09 0:52), Sha Zhengju wrote: From: Sha Zhengju handai@taobao.com Current when a memcg oom is happening the oom dump messages is still global state and provides few useful info for users. This patch prints more pointed memcg page

Re: [PATCH V3] memcg, oom: provide more precise dump info while memcg oom happening

2012-11-09 Thread Sha Zhengju
On 11/09/2012 06:50 PM, Michal Hocko wrote: On Fri 09-11-12 18:23:07, Sha Zhengju wrote: On 11/09/2012 12:25 AM, Michal Hocko wrote: On Thu 08-11-12 23:52:47, Sha Zhengju wrote: [...] + for (i = 0; i MEM_CGROUP_STAT_NSTATS; i++) { + long long val = 0

[PATCH V3] memcg, oom: provide more precise dump info while memcg oom happening

2012-11-08 Thread Sha Zhengju
From: Sha Zhengju Current when a memcg oom is happening the oom dump messages is still global state and provides few useful info for users. This patch prints more pointed memcg page statistics for memcg-oom. We set up a simple cgroup hierarchy for test: root_memcg

Re: [PATCH 2/2] oom: rework dump_tasks to optimize memcg-oom situation

2012-11-08 Thread Sha Zhengju
On 11/08/2012 06:34 AM, Michal Hocko wrote: On Wed 07-11-12 16:41:59, Sha Zhengju wrote: From: Sha Zhengju If memcg oom happening, don't scan all system tasks to dump memory state of eligible tasks, instead we iterates only over the process attached to the oom memcg and avoid the rcu lock

Re: [PATCH 1/2] memcg, oom: provide more precise dump info while memcg oom happening

2012-11-08 Thread Sha Zhengju
On 11/08/2012 05:07 PM, Kamezawa Hiroyuki wrote: > (2012/11/07 17:41), Sha Zhengju wrote: >> From: Sha Zhengju >> >> Current, when a memcg oom is happening the oom dump messages is still global >> state and provides few useful info for users. This patch prints

Re: [PATCH 1/2] memcg, oom: provide more precise dump info while memcg oom happening

2012-11-08 Thread Sha Zhengju
On 11/08/2012 06:17 AM, Michal Hocko wrote: On Wed 07-11-12 16:41:36, Sha Zhengju wrote: From: Sha Zhengju Current, when a memcg oom is happening the oom dump messages is still global state and provides few useful info for users. This patch prints more pointed memcg page statistics for memcg

Re: [PATCH 1/2] memcg, oom: provide more precise dump info while memcg oom happening

2012-11-08 Thread Sha Zhengju
On 11/08/2012 02:02 AM, David Rientjes wrote: On Wed, 7 Nov 2012, Sha Zhengju wrote: diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 0eab7d5..2df5e72 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -118,6 +118,14 @@ static const char * const mem_cgroup_events_names

Re: [PATCH 1/2] memcg, oom: provide more precise dump info while memcg oom happening

2012-11-08 Thread Sha Zhengju
On 11/08/2012 02:02 AM, David Rientjes wrote: On Wed, 7 Nov 2012, Sha Zhengju wrote: diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 0eab7d5..2df5e72 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -118,6 +118,14 @@ static const char * const mem_cgroup_events_names

Re: [PATCH 1/2] memcg, oom: provide more precise dump info while memcg oom happening

2012-11-08 Thread Sha Zhengju
On 11/08/2012 06:17 AM, Michal Hocko wrote: On Wed 07-11-12 16:41:36, Sha Zhengju wrote: From: Sha Zhengjuhandai@taobao.com Current, when a memcg oom is happening the oom dump messages is still global state and provides few useful info for users. This patch prints more pointed memcg page

Re: [PATCH 1/2] memcg, oom: provide more precise dump info while memcg oom happening

2012-11-08 Thread Sha Zhengju
On 11/08/2012 05:07 PM, Kamezawa Hiroyuki wrote: (2012/11/07 17:41), Sha Zhengju wrote: From: Sha Zhengju handai@taobao.com Current, when a memcg oom is happening the oom dump messages is still global state and provides few useful info for users. This patch prints more pointed memcg page

Re: [PATCH 2/2] oom: rework dump_tasks to optimize memcg-oom situation

2012-11-08 Thread Sha Zhengju
On 11/08/2012 06:34 AM, Michal Hocko wrote: On Wed 07-11-12 16:41:59, Sha Zhengju wrote: From: Sha Zhengjuhandai@taobao.com If memcg oom happening, don't scan all system tasks to dump memory state of eligible tasks, instead we iterates only over the process attached to the oom memcg

[PATCH V3] memcg, oom: provide more precise dump info while memcg oom happening

2012-11-08 Thread Sha Zhengju
From: Sha Zhengju handai@taobao.com Current when a memcg oom is happening the oom dump messages is still global state and provides few useful info for users. This patch prints more pointed memcg page statistics for memcg-oom. We set up a simple cgroup hierarchy for test: root_memcg

[PATCH 2/2] oom: rework dump_tasks to optimize memcg-oom situation

2012-11-07 Thread Sha Zhengju
From: Sha Zhengju If memcg oom happening, don't scan all system tasks to dump memory state of eligible tasks, instead we iterates only over the process attached to the oom memcg and avoid the rcu lock. Signed-off-by: Sha Zhengju Cc: Michal Hocko Cc: KAMEZAWA Hiroyuki Cc: David Rientjes Cc

[PATCH 1/2] memcg, oom: provide more precise dump info while memcg oom happening

2012-11-07 Thread Sha Zhengju
From: Sha Zhengju Current, when a memcg oom is happening the oom dump messages is still global state and provides few useful info for users. This patch prints more pointed memcg page statistics for memcg-oom. Signed-off-by: Sha Zhengju Cc: Michal Hocko Cc: KAMEZAWA Hiroyuki Cc: David

[PATCH V2 0/2] Provide more precise dump info for memcg-oom

2012-11-07 Thread Sha Zhengju
From: Sha Zhengju When memcg oom is happening the current memcg related dump information is limited for debugging. The patches provide more detailed memcg page statistics and also take hierarchy into consideration. The previous primitive version can be reached here: https://lkml.org/lkml/2012

[PATCH V2 0/2] Provide more precise dump info for memcg-oom

2012-11-07 Thread Sha Zhengju
From: Sha Zhengju handai@taobao.com When memcg oom is happening the current memcg related dump information is limited for debugging. The patches provide more detailed memcg page statistics and also take hierarchy into consideration. The previous primitive version can be reached here: https

[PATCH 1/2] memcg, oom: provide more precise dump info while memcg oom happening

2012-11-07 Thread Sha Zhengju
From: Sha Zhengju handai@taobao.com Current, when a memcg oom is happening the oom dump messages is still global state and provides few useful info for users. This patch prints more pointed memcg page statistics for memcg-oom. Signed-off-by: Sha Zhengju handai@taobao.com Cc: Michal Hocko

[PATCH 2/2] oom: rework dump_tasks to optimize memcg-oom situation

2012-11-07 Thread Sha Zhengju
From: Sha Zhengju handai@taobao.com If memcg oom happening, don't scan all system tasks to dump memory state of eligible tasks, instead we iterates only over the process attached to the oom memcg and avoid the rcu lock. Signed-off-by: Sha Zhengju handai@taobao.com Cc: Michal Hocko mho

Re: process hangs on do_exit when oom happens

2012-10-23 Thread Sha Zhengju
On 10/23/2012 11:35 AM, Qiang Gao wrote: information about the system is in the attach file "information.txt" I can not reproduce it in the upstream 3.6.0 kernel.. On Sat, Oct 20, 2012 at 12:04 AM, Michal Hocko wrote: On Wed 17-10-12 18:23:34, gaoqiang wrote: I looked up nothing useful with

Re: process hangs on do_exit when oom happens

2012-10-23 Thread Sha Zhengju
On 10/23/2012 11:35 AM, Qiang Gao wrote: information about the system is in the attach file information.txt I can not reproduce it in the upstream 3.6.0 kernel.. On Sat, Oct 20, 2012 at 12:04 AM, Michal Hockomho...@suse.cz wrote: On Wed 17-10-12 18:23:34, gaoqiang wrote: I looked up nothing

Re: [PATCH] oom, memcg: handle sysctl oom_kill_allocating_task while memcg oom happening

2012-10-18 Thread Sha Zhengju
On 10/18/2012 11:32 PM, Michal Hocko wrote: On Thu 18-10-12 21:51:57, Sha Zhengju wrote: On 10/18/2012 07:56 PM, Michal Hocko wrote: On Wed 17-10-12 01:14:48, Sha Zhengju wrote: On Tuesday, October 16, 2012, Michal Hocko wrote: [...] Could you be more specific about the motivation

Re: [PATCH] oom, memcg: handle sysctl oom_kill_allocating_task while memcg oom happening

2012-10-18 Thread Sha Zhengju
On 10/18/2012 07:56 PM, Michal Hocko wrote: On Wed 17-10-12 01:14:48, Sha Zhengju wrote: On Tuesday, October 16, 2012, Michal Hocko wrote: [...] Could you be more specific about the motivation for this patch? Is it "let's be consistent with the global oom" or you have a rea

Re: [PATCH] oom, memcg: handle sysctl oom_kill_allocating_task while memcg oom happening

2012-10-18 Thread Sha Zhengju
On 10/18/2012 11:32 PM, Michal Hocko wrote: On Thu 18-10-12 21:51:57, Sha Zhengju wrote: On 10/18/2012 07:56 PM, Michal Hocko wrote: On Wed 17-10-12 01:14:48, Sha Zhengju wrote: On Tuesday, October 16, 2012, Michal Hockomho...@suse.cz wrote: [...] Could you be more specific about

Re: [PATCH] oom, memcg: handle sysctl oom_kill_allocating_task while memcg oom happening

2012-10-18 Thread Sha Zhengju
On 10/18/2012 07:56 PM, Michal Hocko wrote: On Wed 17-10-12 01:14:48, Sha Zhengju wrote: On Tuesday, October 16, 2012, Michal Hockomho...@suse.cz wrote: [...] Could you be more specific about the motivation for this patch? Is it let's be consistent with the global oom or you have a real use

Re: [PATCH] oom, memcg: handle sysctl oom_kill_allocating_task while memcg oom happening

2012-10-16 Thread Sha Zhengju
On 10/16/2012 06:20 PM, Ni zhan Chen wrote: On 10/16/2012 06:12 PM, Sha Zhengju wrote: From: Sha Zhengju Sysctl oom_kill_allocating_task enables or disables killing the OOM-triggering task in out-of-memory situations, but it only works on overall system-wide oom. But it's also a useful

[PATCH] oom, memcg: handle sysctl oom_kill_allocating_task while memcg oom happening

2012-10-16 Thread Sha Zhengju
From: Sha Zhengju Sysctl oom_kill_allocating_task enables or disables killing the OOM-triggering task in out-of-memory situations, but it only works on overall system-wide oom. But it's also a useful indication in memcg so we take it into consideration while oom happening in memcg. Other sysctl

  1   2   >