linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp>
To: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: linux-mm <linux-mm@kvack.org>,
	Balbir Singh <balbir@linux.vnet.ibm.com>,
	Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp>
Subject: Re: [RFC][PATCH 0/8] memcg: recharge at task move (Oct13)
Date: Thu, 15 Oct 2009 09:27:31 +0900	[thread overview]
Message-ID: <20091015092731.a13456fb.nishimura@mxp.nes.nec.co.jp> (raw)
In-Reply-To: <20091014160350.22185f3f.kamezawa.hiroyu@jp.fujitsu.com>

Thank you for your comments.

On Wed, 14 Oct 2009 16:03:50 +0900, KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> wrote:
> On Tue, 13 Oct 2009 13:49:03 +0900
> Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp> wrote:
> 
> > Hi.
> > 
> > These are my current patches for recharge at task move.
> > 
> > In current memcg, charges associated with a task aren't moved to the new cgroup
> > at task move. These patches are for this feature, that is, for recharging to
> > the new cgroup and, of course, uncharging from old cgroup at task move.
> > 
> > I've tested these patches on 2.6.32-rc3(+ some patches) with memory pressure
> > and rmdir, they didn't cause any BUGs during last weekend.
> > 
> > Major Changes from Sep24:
> > - rebased on mmotm-2009-10-09-01-07 + KAMEZAWA-san's batched charge/uncharge(Oct09)
> >   + part of KAMEZAWA-san's cleanup/fix patches(4,5,7 of Sep25 with some fixes).
> > - changed the term "migrate" to "recharge".
> > 
> > TODO:
> > - update Documentation/cgroup/memory.txt
> > - implement madvise(2) (MADV_MEMCG_RECHARGE/NORECHARGE)
> > 
> 
> Seems nice in general.
> 
Thanks.

> But, as 1st version, could you postpone recharging "shared pages" ?
> I think automatic recharge of them is not very good. I don't like
> Moving anonymous "shared" pages and file pages.
> 
Just for clarification, you mean "page_mapcount > 1" by "shared", right?

> When a user use this method.
> ==
>    if (fork()) {
> 	add this to cgroup
> 	execve()
>    }
> ==
> All parent's memory will be recharged.
> 
yes.

> I wonder, use madivse(MADV_MEMCG_AUTO_RECHARGE) to set flag to vmas
> and use the flag as hint to auto-recharge will be good idea, finally.
> 
> (*) To be honest, I believe users will not want to modify their program
>     only for this. So, recharging secified vma/file/shmem by external
>     program will be necessary.
> 
I think adding new MADV_MEMCG_** would make sense, I agree that users
will not want to modify their program though and it would be a desirable feature
to specify a vma to be recharged by external program(I don't have any idea now to do it).

I think extending the meaning of memory.recharge_at_immigrate(or adding
new flag file) can be used to some extent for an administrator(or a middle ware)
to decide the type of pages to be recharged.

> 
> For another example, an admin tries to charge libXYZ.so into /group_A.
> He can do
>    # echo 0 > ..../group_A/tasks.
>    # cat libXYZ.so > /dev/null
> 
> After that, if a user moves a program in group_A which uses libXYZ.so,
> libXYZ.so will be recharged automatically.
> 
hmm, yes.

> There will be several policy around this. But start-from-minimum is not very
> bad for this functionality because we have no feature now.
> 
> Could you start from recharge "not shared pages" ?
> We'll be able to update feature, for example, add flag to memcg as
> your 1st version does.
> 
I see your concern and I agree that we can start from minimum and enhance later.

I adopted mandatory policy just because, without support for shared pages for example,
we can never recharge those pages even after all of the processes that uses those
shared pages are moved to new group.

I've not considered thoroughly yet, my current plan is
  - add support for new page type
    - file pages
    - shmem/tmpfs page
  - add support for shared(page_mapcount > 1) pages

Anyway, I'll repost my patches with only support for non-shared-anon pages
(and swaps of those pages if possible) as a 1st version.


Thanks,
Daisuke Nishimura.

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

      reply	other threads:[~2009-10-15  0:36 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-13  4:49 Daisuke Nishimura
2009-10-13  4:50 ` [RFC][PATCH 1/8] cgroup: introduce cancel_attach() Daisuke Nishimura
2009-10-15  7:37   ` Paul Menage
2009-10-15  8:50     ` Paul Menage
2009-10-15 11:08     ` Daisuke Nishimura
2009-10-13  4:51 ` [RFC][PATCH 2/8] memcg: cleanup mem_cgroup_move_parent() Daisuke Nishimura
2009-10-13  4:52 ` [RFC][PATCH 3/8] memcg: move memcg_tasklist mutex Daisuke Nishimura
2009-10-13  4:53 ` [RFC][PATCH 4/8] memcg: add interface to recharge at task move Daisuke Nishimura
2009-10-13  4:55 ` [RFC][PATCH 5/8] memcg: recharge charges of mapped page Daisuke Nishimura
2009-10-13  4:56 ` [RFC][PATCH 6/8] memcg: avoid oom during recharge at task move Daisuke Nishimura
2009-10-13  4:57 ` [RFC][PATCH 7/8] memcg: recharge charges of anonymous swap Daisuke Nishimura
2009-10-13  4:58 ` [RFC][PATCH 8/8] memcg: recharge charges of shmem swap Daisuke Nishimura
2009-10-14  7:03 ` [RFC][PATCH 0/8] memcg: recharge at task move (Oct13) KAMEZAWA Hiroyuki
2009-10-15  0:27   ` Daisuke Nishimura [this message]

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=20091015092731.a13456fb.nishimura@mxp.nes.nec.co.jp \
    --to=nishimura@mxp.nes.nec.co.jp \
    --cc=balbir@linux.vnet.ibm.com \
    --cc=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=linux-mm@kvack.org \
    /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