From: Andrea Righi <arighi@develer.com>
To: Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp>
Cc: Balbir Singh <balbir@linux.vnet.ibm.com>,
KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
Suleiman Souhlal <suleiman@google.com>,
Greg Thelen <gthelen@google.com>,
"Kirill A. Shutemov" <kirill@shutemov.name>,
Andrew Morton <akpm@linux-foundation.org>,
containers@lists.linux-foundation.org,
linux-kernel@vger.kernel.org, linux-mm@kvack.org
Subject: Re: [PATCH -mmotm 3/3] memcg: dirty pages instrumentation
Date: Wed, 3 Mar 2010 12:48:52 +0100 [thread overview]
Message-ID: <20100303114852.GB1990@linux> (raw)
In-Reply-To: <20100303082107.a29562fa.nishimura@mxp.nes.nec.co.jp>
On Wed, Mar 03, 2010 at 08:21:07AM +0900, Daisuke Nishimura wrote:
> On Tue, 2 Mar 2010 23:18:23 +0100, Andrea Righi <arighi@develer.com> wrote:
> > On Tue, Mar 02, 2010 at 07:20:26PM +0530, Balbir Singh wrote:
> > > * KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> [2010-03-02 17:23:16]:
> > >
> > > > On Tue, 2 Mar 2010 09:01:58 +0100
> > > > Andrea Righi <arighi@develer.com> 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 <arighi@develer.com> wrote:
> > > > > >
> > > > > > > Apply the cgroup dirty pages accounting and limiting infrastructure to
> > > > > > > the opportune kernel functions.
> > > > > > >
> > > > > > > Signed-off-by: Andrea Righi <arighi@develer.com>
> > > > > >
> > > > > > Seems nice.
> > > > > >
> > > > > > Hmm. the last problem is moving account between memcg.
> > > > > >
> > > > > > Right ?
> > > > >
> > > > > Correct. This was actually the last item of the TODO list. Anyway, I'm
> > > > > still considering if it's correct to move dirty pages when a task is
> > > > > migrated from a cgroup to another. Currently, dirty pages just remain in
> > > > > the original cgroup and are flushed depending on the original cgroup
> > > > > settings. That is not totally wrong... at least moving the dirty pages
> > > > > between memcgs should be optional (move_charge_at_immigrate?).
> > > > >
> > > >
> > > > My concern is
> > > > - migration between memcg is already suppoted
> > > > - at task move
> > > > - at rmdir
> > > >
> > > > Then, if you leave DIRTY_PAGE accounting to original cgroup,
> > > > the new cgroup (migration target)'s Dirty page accounting may
> > > > goes to be negative, or incorrect value. Please check FILE_MAPPED
> > > > implementation in __mem_cgroup_move_account()
> > > >
> > > > As
> > > > if (page_mapped(page) && !PageAnon(page)) {
> > > > /* Update mapped_file data for mem_cgroup */
> > > > preempt_disable();
> > > > __this_cpu_dec(from->stat->count[MEM_CGROUP_STAT_FILE_MAPPED]);
> > > > __this_cpu_inc(to->stat->count[MEM_CGROUP_STAT_FILE_MAPPED]);
> > > > preempt_enable();
> > > > }
> > > > then, FILE_MAPPED never goes negative.
> > > >
> > >
> > > Absolutely! I am not sure how complex dirty memory migration will be,
> > > but one way of working around it would be to disable migration of
> > > charges when the feature is enabled (dirty* is set in the memory
> > > cgroup). We might need additional logic to allow that to happen.
> >
> > I've started to look at dirty memory migration. First attempt is to add
> > DIRTY, WRITEBACK, etc. to page_cgroup flags and handle them in
> > __mem_cgroup_move_account(). Probably I'll have something ready for the
> > next version of the patch. I still need to figure if this can work as
> > expected...
> >
> I agree it's a right direction(in fact, I have been planning to post a patch
> in that direction), so I leave it to you.
> Can you add PCG_FILE_MAPPED flag too ? I think this flag can be handled in the
> same way as other flags you're trying to add, and we can change
> "if (page_mapped(page) && !PageAnon(page))" to "if (PageCgroupFileMapped(pc)"
> in __mem_cgroup_move_account(). It would be cleaner than current code, IMHO.
OK, sounds good to me. I'll introduce PCG_FILE_MAPPED in the next
version.
Thanks,
-Andrea
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2010-03-03 11:48 UTC|newest]
Thread overview: 47+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-01 21:23 [PATCH -mmotm 0/3] memcg: per cgroup dirty limit (v3) Andrea Righi
2010-03-01 21:23 ` [PATCH -mmotm 1/3] memcg: dirty memory documentation Andrea Righi
2010-03-01 21:23 ` [PATCH -mmotm 2/3] memcg: dirty pages accounting and limiting infrastructure Andrea Righi
2010-03-02 0:20 ` KAMEZAWA Hiroyuki
2010-03-02 10:04 ` Kirill A. Shutemov
2010-03-02 11:00 ` Andrea Righi
2010-03-02 13:02 ` Balbir Singh
2010-03-02 21:50 ` Andrea Righi
2010-03-02 18:08 ` Greg Thelen
2010-03-02 22:24 ` Andrea Righi
2010-03-01 21:23 ` [PATCH -mmotm 3/3] memcg: dirty pages instrumentation Andrea Righi
2010-03-01 22:02 ` Vivek Goyal
2010-03-01 22:18 ` Andrea Righi
2010-03-02 15:05 ` Vivek Goyal
2010-03-02 22:22 ` Andrea Righi
2010-03-02 23:59 ` Vivek Goyal
2010-03-03 11:47 ` Andrea Righi
2010-03-03 11:56 ` Andrea Righi
2010-03-02 0:23 ` KAMEZAWA Hiroyuki
2010-03-02 8:01 ` Andrea Righi
2010-03-02 8:12 ` Daisuke Nishimura
2010-03-02 8:23 ` KAMEZAWA Hiroyuki
2010-03-02 13:50 ` Balbir Singh
2010-03-02 22:18 ` Andrea Righi
2010-03-02 23:21 ` Daisuke Nishimura
2010-03-03 11:48 ` Andrea Righi [this message]
2010-03-02 10:11 ` Kirill A. Shutemov
2010-03-02 11:02 ` Andrea Righi
2010-03-02 11:09 ` Kirill A. Shutemov
2010-03-02 11:34 ` Andrea Righi
2010-03-02 13:47 ` Balbir Singh
2010-03-02 13:56 ` Kirill A. Shutemov
2010-03-02 13:48 ` Peter Zijlstra
2010-03-02 15:26 ` Balbir Singh
2010-03-02 15:49 ` Trond Myklebust
2010-03-02 22:14 ` Andrea Righi
2010-03-03 10:07 ` Peter Zijlstra
2010-03-03 12:05 ` Andrea Righi
2010-03-03 2:12 ` Daisuke Nishimura
2010-03-03 3:29 ` KAMEZAWA Hiroyuki
2010-03-03 6:01 ` Daisuke Nishimura
2010-03-03 6:15 ` KAMEZAWA Hiroyuki
2010-03-03 8:21 ` KAMEZAWA Hiroyuki
2010-03-03 11:50 ` Andrea Righi
2010-03-03 22:03 ` Andrea Righi
2010-03-03 23:25 ` Daisuke Nishimura
2010-03-04 3:45 ` KAMEZAWA Hiroyuki
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100303114852.GB1990@linux \
--to=arighi@develer.com \
--cc=akpm@linux-foundation.org \
--cc=balbir@linux.vnet.ibm.com \
--cc=containers@lists.linux-foundation.org \
--cc=gthelen@google.com \
--cc=kamezawa.hiroyu@jp.fujitsu.com \
--cc=kirill@shutemov.name \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=nishimura@mxp.nes.nec.co.jp \
--cc=suleiman@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).