[Devel] Re: [PATCH -mmotm 3/3] memcg: dirty pages instrumentation

2010-03-30 Thread Andrea Righi
On Wed, Mar 03, 2010 at 05:21:32PM +0900, KAMEZAWA Hiroyuki wrote: > On Wed, 3 Mar 2010 15:15:49 +0900 > KAMEZAWA Hiroyuki wrote: > > > Agreed. > > Let's try how we can write a code in clean way. (we have time ;) > > For now, to me, IRQ disabling while lock_page_cgroup() seems to be a little > >

[Devel] Re: [PATCH -mmotm 3/3] memcg: dirty pages instrumentation

2010-03-30 Thread Andrea Righi
On Wed, Mar 03, 2010 at 11:07:35AM +0100, Peter Zijlstra wrote: > On Tue, 2010-03-02 at 23:14 +0100, Andrea Righi wrote: > > > > I agree mem_cgroup_has_dirty_limit() is nicer. But we must do that under > > RCU, so something like: > > > > rcu_read_lock(); > > if (mem_cgroup_has_dir

[Devel] Re: [PATCH -mmotm 3/3] memcg: dirty pages instrumentation

2010-03-30 Thread Andrea Righi
On Wed, Mar 03, 2010 at 12:47:03PM +0100, Andrea Righi wrote: > On Tue, Mar 02, 2010 at 06:59:32PM -0500, Vivek Goyal wrote: > > On Tue, Mar 02, 2010 at 11:22:48PM +0100, Andrea Righi wrote: > > > On Tue, Mar 02, 2010 at 10:05:29AM -0500, Vivek Goyal wrote: > > > > On Mon, Mar 01, 2010 at 11:18:31P

[Devel] Re: [PATCH -mmotm 3/3] memcg: dirty pages instrumentation

2010-03-30 Thread Andrea Righi
On Wed, Mar 03, 2010 at 05:21:32PM +0900, KAMEZAWA Hiroyuki wrote: > On Wed, 3 Mar 2010 15:15:49 +0900 > KAMEZAWA Hiroyuki wrote: > > > Agreed. > > Let's try how we can write a code in clean way. (we have time ;) > > For now, to me, IRQ disabling while lock_page_cgroup() seems to be a little > >

[Devel] Re: [PATCH -mmotm 3/3] memcg: dirty pages instrumentation

2010-03-30 Thread Andrea Righi
On Wed, Mar 03, 2010 at 08:21:07AM +0900, Daisuke Nishimura wrote: > On Tue, 2 Mar 2010 23:18:23 +0100, Andrea Righi wrote: > > On Tue, Mar 02, 2010 at 07:20:26PM +0530, Balbir Singh wrote: > > > * KAMEZAWA Hiroyuki [2010-03-02 > > > 17:23:16]: > > > > > > > On Tue, 2 Mar 2010 09:01:58 +0100 >

[Devel] Re: [PATCH -mmotm 3/3] memcg: dirty pages instrumentation

2010-03-30 Thread Andrea Righi
On Tue, Mar 02, 2010 at 06:59:32PM -0500, Vivek Goyal wrote: > On Tue, Mar 02, 2010 at 11:22:48PM +0100, Andrea Righi wrote: > > On Tue, Mar 02, 2010 at 10:05:29AM -0500, Vivek Goyal wrote: > > > On Mon, Mar 01, 2010 at 11:18:31PM +0100, Andrea Righi wrote: > > > > On Mon, Mar 01, 2010 at 05:02:08P

[Devel] Re: [PATCH -mmotm 3/3] memcg: dirty pages instrumentation

2010-03-30 Thread Andrea Righi
On Tue, Mar 02, 2010 at 10:05:29AM -0500, Vivek Goyal wrote: > On Mon, Mar 01, 2010 at 11:18:31PM +0100, Andrea Righi wrote: > > On Mon, Mar 01, 2010 at 05:02:08PM -0500, Vivek Goyal wrote: > > > > @@ -686,10 +699,14 @@ void throttle_vm_writeout(gfp_t gfp_mask) > > > > */ > > > >

[Devel] Re: [PATCH -mmotm 3/3] memcg: dirty pages instrumentation

2010-03-30 Thread Andrea Righi
On Tue, Mar 02, 2010 at 07:20:26PM +0530, Balbir Singh wrote: > * KAMEZAWA Hiroyuki [2010-03-02 17:23:16]: > > > On Tue, 2 Mar 2010 09:01:58 +0100 > > Andrea Righi wrote: > > > > > On Tue, Mar 02, 2010 at 09:23:09AM +0900, KAMEZAWA Hiroyuki wrote: > > > > On Mon, 1 Mar 2010 22:23:40 +0100 > >

[Devel] Re: [PATCH -mmotm 3/3] memcg: dirty pages instrumentation

2010-03-30 Thread Andrea Righi
On Tue, Mar 02, 2010 at 02:48:56PM +0100, Peter Zijlstra wrote: > On Mon, 2010-03-01 at 22:23 +0100, Andrea Righi wrote: > > Apply the cgroup dirty pages accounting and limiting infrastructure to > > the opportune kernel functions. > > > > Signed-off-by: Andrea Righi > > --- > > > diff --git a/m

[Devel] Re: [PATCH -mmotm 3/3] memcg: dirty pages instrumentation

2010-03-30 Thread Andrea Righi
On Tue, Mar 02, 2010 at 01:09:24PM +0200, Kirill A. Shutemov wrote: > On Tue, Mar 2, 2010 at 1:02 PM, Andrea Righi wrote: > > On Tue, Mar 02, 2010 at 12:11:10PM +0200, Kirill A. Shutemov wrote: > >> On Mon, Mar 1, 2010 at 11:23 PM, Andrea Righi wrote: > >> > Apply the cgroup dirty pages accountin

[Devel] Re: [PATCH -mmotm 3/3] memcg: dirty pages instrumentation

2010-03-30 Thread Andrea Righi
On Tue, Mar 02, 2010 at 12:11:10PM +0200, Kirill A. Shutemov wrote: > On Mon, Mar 1, 2010 at 11:23 PM, Andrea Righi wrote: > > Apply the cgroup dirty pages accounting and limiting infrastructure to > > the opportune kernel functions. > > > > Signed-off-by: Andrea Righi > > --- > >  fs/fuse/file.c

[Devel] Re: [PATCH -mmotm 3/3] memcg: dirty pages instrumentation

2010-03-30 Thread Andrea Righi
On Tue, Mar 02, 2010 at 09:23:09AM +0900, KAMEZAWA Hiroyuki wrote: > On Mon, 1 Mar 2010 22:23:40 +0100 > Andrea Righi wrote: > > > Apply the cgroup dirty pages accounting and limiting infrastructure to > > the opportune kernel functions. > > > > Signed-off-by: Andrea Righi > > Seems nice. >

[Devel] Re: [PATCH -mmotm 3/3] memcg: dirty pages instrumentation

2010-03-30 Thread Andrea Righi
On Mon, Mar 01, 2010 at 05:02:08PM -0500, Vivek Goyal wrote: > > @@ -686,10 +699,14 @@ void throttle_vm_writeout(gfp_t gfp_mask) > > */ > > dirty_thresh += dirty_thresh / 10; /* wh... */ > > > > -if (global_page_state(NR_UNSTABLE_NFS) +

[Devel] Re: [PATCH -mmotm 3/3] memcg: dirty pages instrumentation

2010-03-03 Thread KAMEZAWA Hiroyuki
On Wed, 3 Mar 2010 23:03:19 +0100 Andrea Righi wrote: > On Wed, Mar 03, 2010 at 05:21:32PM +0900, KAMEZAWA Hiroyuki wrote: > > On Wed, 3 Mar 2010 15:15:49 +0900 > > KAMEZAWA Hiroyuki wrote: > > + preempt_disable(); > > + lock_page_cgroup_migrate(pc); > > page = pc->page; > > if (pa

[Devel] Re: [PATCH -mmotm 3/3] memcg: dirty pages instrumentation

2010-03-03 Thread Daisuke Nishimura
On Wed, 3 Mar 2010 23:03:19 +0100, Andrea Righi wrote: > On Wed, Mar 03, 2010 at 05:21:32PM +0900, KAMEZAWA Hiroyuki wrote: > > On Wed, 3 Mar 2010 15:15:49 +0900 > > KAMEZAWA Hiroyuki wrote: > > > > > Agreed. > > > Let's try how we can write a code in clean way. (we have time ;) > > > For now, t

[Devel] Re: [PATCH -mmotm 3/3] memcg: dirty pages instrumentation

2010-03-03 Thread Peter Zijlstra
On Tue, 2010-03-02 at 23:14 +0100, Andrea Righi wrote: > > I agree mem_cgroup_has_dirty_limit() is nicer. But we must do that under > RCU, so something like: > > rcu_read_lock(); > if (mem_cgroup_has_dirty_limit()) > mem_cgroup_get_page_stat() > else >

[Devel] Re: [PATCH -mmotm 3/3] memcg: dirty pages instrumentation

2010-03-03 Thread KAMEZAWA Hiroyuki
On Wed, 3 Mar 2010 15:15:49 +0900 KAMEZAWA Hiroyuki wrote: > Agreed. > Let's try how we can write a code in clean way. (we have time ;) > For now, to me, IRQ disabling while lock_page_cgroup() seems to be a little > over killing. What I really want is lockless code...but it seems impossible > und

[Devel] Re: [PATCH -mmotm 3/3] memcg: dirty pages instrumentation

2010-03-02 Thread KAMEZAWA Hiroyuki
On Wed, 3 Mar 2010 15:01:37 +0900 Daisuke Nishimura wrote: > On Wed, 3 Mar 2010 12:29:06 +0900, KAMEZAWA Hiroyuki > wrote: > > On Wed, 3 Mar 2010 11:12:38 +0900 > > Daisuke Nishimura wrote: > > > > > > diff --git a/mm/filemap.c b/mm/filemap.c > > > > index fe09e51..f85acae 100644 > > > > ---

[Devel] Re: [PATCH -mmotm 3/3] memcg: dirty pages instrumentation

2010-03-02 Thread Daisuke Nishimura
On Wed, 3 Mar 2010 12:29:06 +0900, KAMEZAWA Hiroyuki wrote: > On Wed, 3 Mar 2010 11:12:38 +0900 > Daisuke Nishimura wrote: > > > > diff --git a/mm/filemap.c b/mm/filemap.c > > > index fe09e51..f85acae 100644 > > > --- a/mm/filemap.c > > > +++ b/mm/filemap.c > > > @@ -135,6 +135,7 @@ void __remo

[Devel] Re: [PATCH -mmotm 3/3] memcg: dirty pages instrumentation

2010-03-02 Thread KAMEZAWA Hiroyuki
On Wed, 3 Mar 2010 11:12:38 +0900 Daisuke Nishimura wrote: > > diff --git a/mm/filemap.c b/mm/filemap.c > > index fe09e51..f85acae 100644 > > --- a/mm/filemap.c > > +++ b/mm/filemap.c > > @@ -135,6 +135,7 @@ void __remove_from_page_cache(struct page *page) > > * having removed the page entir

[Devel] Re: [PATCH -mmotm 3/3] memcg: dirty pages instrumentation

2010-03-02 Thread Daisuke Nishimura
> diff --git a/mm/filemap.c b/mm/filemap.c > index fe09e51..f85acae 100644 > --- a/mm/filemap.c > +++ b/mm/filemap.c > @@ -135,6 +135,7 @@ void __remove_from_page_cache(struct page *page) >* having removed the page entirely. >*/ > if (PageDirty(page) && mapping_cap_account_dir

[Devel] Re: [PATCH -mmotm 3/3] memcg: dirty pages instrumentation

2010-03-02 Thread Vivek Goyal
On Tue, Mar 02, 2010 at 11:22:48PM +0100, Andrea Righi wrote: > On Tue, Mar 02, 2010 at 10:05:29AM -0500, Vivek Goyal wrote: > > On Mon, Mar 01, 2010 at 11:18:31PM +0100, Andrea Righi wrote: > > > On Mon, Mar 01, 2010 at 05:02:08PM -0500, Vivek Goyal wrote: > > > > > @@ -686,10 +699,14 @@ void thro

[Devel] Re: [PATCH -mmotm 3/3] memcg: dirty pages instrumentation

2010-03-02 Thread Daisuke Nishimura
On Tue, 2 Mar 2010 23:18:23 +0100, Andrea Righi wrote: > On Tue, Mar 02, 2010 at 07:20:26PM +0530, Balbir Singh wrote: > > * KAMEZAWA Hiroyuki [2010-03-02 17:23:16]: > > > > > On Tue, 2 Mar 2010 09:01:58 +0100 > > > Andrea Righi wrote: > > > > > > > On Tue, Mar 02, 2010 at 09:23:09AM +0900, KA

[Devel] Re: [PATCH -mmotm 3/3] memcg: dirty pages instrumentation

2010-03-02 Thread Trond Myklebust
On Tue, 2010-03-02 at 14:48 +0100, Peter Zijlstra wrote: > unsigned long reclaimable_pages(cgroup) > { > if (mem_cgroup_has_dirty_limit(cgroup)) > return mem_cgroup_page_stat(MEMCG_NR_RECLAIM_PAGES); > > return global_page_state(NR_FILE_DIRTY) + > global_page_state(NR_NFS_UNSTABLE); >

[Devel] Re: [PATCH -mmotm 3/3] memcg: dirty pages instrumentation

2010-03-02 Thread Balbir Singh
* Peter Zijlstra [2010-03-02 14:48:56]: > This is ugly and broken.. I thought you'd agreed to something like: > > if (mem_cgroup_has_dirty_limit(cgroup)) >use mem_cgroup numbers > else >use global numbers > > That allows for a 0 dirty limit (which should work and basically makes > all

[Devel] Re: [PATCH -mmotm 3/3] memcg: dirty pages instrumentation

2010-03-02 Thread Vivek Goyal
On Mon, Mar 01, 2010 at 11:18:31PM +0100, Andrea Righi wrote: > On Mon, Mar 01, 2010 at 05:02:08PM -0500, Vivek Goyal wrote: > > > @@ -686,10 +699,14 @@ void throttle_vm_writeout(gfp_t gfp_mask) > > > */ > > > dirty_thresh += dirty_thresh / 10; /* wh... *

[Devel] Re: [PATCH -mmotm 3/3] memcg: dirty pages instrumentation

2010-03-02 Thread Kirill A. Shutemov
On Tue, Mar 2, 2010 at 3:47 PM, Balbir Singh wrote: > * Andrea Righi [2010-03-01 22:23:40]: > >> Apply the cgroup dirty pages accounting and limiting infrastructure to >> the opportune kernel functions. >> >> Signed-off-by: Andrea Righi >> --- >>  fs/fuse/file.c      |    5 +++ >>  fs/nfs/write.

[Devel] Re: [PATCH -mmotm 3/3] memcg: dirty pages instrumentation

2010-03-02 Thread Balbir Singh
* KAMEZAWA Hiroyuki [2010-03-02 17:23:16]: > On Tue, 2 Mar 2010 09:01:58 +0100 > Andrea Righi wrote: > > > On Tue, Mar 02, 2010 at 09:23:09AM +0900, KAMEZAWA Hiroyuki wrote: > > > On Mon, 1 Mar 2010 22:23:40 +0100 > > > Andrea Righi wrote: > > > > > > > Apply the cgroup dirty pages accountin

[Devel] Re: [PATCH -mmotm 3/3] memcg: dirty pages instrumentation

2010-03-02 Thread Peter Zijlstra
On Mon, 2010-03-01 at 22:23 +0100, Andrea Righi wrote: > Apply the cgroup dirty pages accounting and limiting infrastructure to > the opportune kernel functions. > > Signed-off-by: Andrea Righi > --- > diff --git a/mm/page-writeback.c b/mm/page-writeback.c > index 5a0f8f3..d83f41c 100644 > --- a

[Devel] Re: [PATCH -mmotm 3/3] memcg: dirty pages instrumentation

2010-03-02 Thread Balbir Singh
* Andrea Righi [2010-03-01 22:23:40]: > Apply the cgroup dirty pages accounting and limiting infrastructure to > the opportune kernel functions. > > Signed-off-by: Andrea Righi > --- > fs/fuse/file.c |5 +++ > fs/nfs/write.c |4 ++ > fs/nilfs2/segment.c | 10 +- > mm/fi

[Devel] Re: [PATCH -mmotm 3/3] memcg: dirty pages instrumentation

2010-03-02 Thread Kirill A. Shutemov
On Tue, Mar 2, 2010 at 1:02 PM, Andrea Righi wrote: > On Tue, Mar 02, 2010 at 12:11:10PM +0200, Kirill A. Shutemov wrote: >> On Mon, Mar 1, 2010 at 11:23 PM, Andrea Righi wrote: >> > Apply the cgroup dirty pages accounting and limiting infrastructure to >> > the opportune kernel functions. >> > >

[Devel] Re: [PATCH -mmotm 3/3] memcg: dirty pages instrumentation

2010-03-02 Thread Kirill A. Shutemov
On Mon, Mar 1, 2010 at 11:23 PM, Andrea Righi wrote: > Apply the cgroup dirty pages accounting and limiting infrastructure to > the opportune kernel functions. > > Signed-off-by: Andrea Righi > --- >  fs/fuse/file.c      |    5 +++ >  fs/nfs/write.c      |    4 ++ >  fs/nilfs2/segment.c |   10 ++

[Devel] Re: [PATCH -mmotm 3/3] memcg: dirty pages instrumentation

2010-03-02 Thread KAMEZAWA Hiroyuki
On Tue, 2 Mar 2010 09:01:58 +0100 Andrea Righi wrote: > On Tue, Mar 02, 2010 at 09:23:09AM +0900, KAMEZAWA Hiroyuki wrote: > > On Mon, 1 Mar 2010 22:23:40 +0100 > > Andrea Righi wrote: > > > > > Apply the cgroup dirty pages accounting and limiting infrastructure to > > > the opportune kernel f

[Devel] Re: [PATCH -mmotm 3/3] memcg: dirty pages instrumentation

2010-03-02 Thread Daisuke Nishimura
On Tue, 2 Mar 2010 09:01:58 +0100, Andrea Righi wrote: > On Tue, Mar 02, 2010 at 09:23:09AM +0900, KAMEZAWA Hiroyuki wrote: > > On Mon, 1 Mar 2010 22:23:40 +0100 > > Andrea Righi wrote: > > > > > Apply the cgroup dirty pages accounting and limiting infrastructure to > > > the opportune kernel f

[Devel] Re: [PATCH -mmotm 3/3] memcg: dirty pages instrumentation

2010-03-01 Thread KAMEZAWA Hiroyuki
On Mon, 1 Mar 2010 22:23:40 +0100 Andrea Righi wrote: > Apply the cgroup dirty pages accounting and limiting infrastructure to > the opportune kernel functions. > > Signed-off-by: Andrea Righi Seems nice. Hmm. the last problem is moving account between memcg. Right ? Thanks, -Kame > ---

[Devel] Re: [PATCH -mmotm 3/3] memcg: dirty pages instrumentation

2010-03-01 Thread Vivek Goyal
On Mon, Mar 01, 2010 at 10:23:40PM +0100, Andrea Righi wrote: > Apply the cgroup dirty pages accounting and limiting infrastructure to > the opportune kernel functions. > > Signed-off-by: Andrea Righi > --- > fs/fuse/file.c |5 +++ > fs/nfs/write.c |4 ++ > fs/nilfs2/segment.c