From: Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Balbir Singh <balbir@linux.vnet.ibm.com>,
KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
Li Zefan <lizf@cn.fujitsu.com>, Paul Menage <menage@google.com>,
linux-mm <linux-mm@kvack.org>,
Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp>
Subject: Re: [PATCH -mmotm 7/8] memcg: move charges of anonymous swap
Date: Thu, 4 Feb 2010 14:09:42 +0900 [thread overview]
Message-ID: <20100204140942.0ef6d7b1.nishimura@mxp.nes.nec.co.jp> (raw)
In-Reply-To: <20100203193127.fe5efa17.akpm@linux-foundation.org>
On Wed, 3 Feb 2010 19:31:27 -0800, Andrew Morton <akpm@linux-foundation.org> wrote:
> On Mon, 21 Dec 2009 14:38:16 +0900 Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp> wrote:
>
> > This patch is another core part of this move-charge-at-task-migration feature.
> > It enables moving charges of anonymous swaps.
> >
> > To move the charge of swap, we need to exchange swap_cgroup's record.
> >
> > In current implementation, swap_cgroup's record is protected by:
> >
> > - page lock: if the entry is on swap cache.
> > - swap_lock: if the entry is not on swap cache.
> >
> > This works well in usual swap-in/out activity.
> >
> > But this behavior make the feature of moving swap charge check many conditions
> > to exchange swap_cgroup's record safely.
> >
> > So I changed modification of swap_cgroup's recored(swap_cgroup_record())
> > to use xchg, and define a new function to cmpxchg swap_cgroup's record.
> >
> > This patch also enables moving charge of non pte_present but not uncharged swap
> > caches, which can be exist on swap-out path, by getting the target pages via
> > find_get_page() as do_mincore() does.
> >
> >
> > ...
> >
> > + else if (is_swap_pte(ptent)) {
>
> is_swap_pte() isn't implemented for CONFIG_MMU=n, so the build breaks.
Ah, you're right. I'm sorry I don't have any evironment to test !CONFIG_MMU.
Using #ifdef like below would be the simplest fix(SWAP is depend on MMU),
but hmm, #ifdef is ugly.
I'll prepare another fix.
===
From: Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp>
build fix in !CONFIG_MMU case.
Signed-off-by: Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp>
---
mm/memcontrol.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index 953b18b..85b48cb 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -3635,6 +3635,7 @@ static int is_target_pte_for_mc(struct vm_area_struct *vma,
&mc.to->move_charge_at_immigrate);
if (!pte_present(ptent)) {
+#ifdef CONFIG_SWAP
/* TODO: handle swap of shmes/tmpfs */
if (pte_none(ptent) || pte_file(ptent))
return 0;
@@ -3644,6 +3645,7 @@ static int is_target_pte_for_mc(struct vm_area_struct *vma,
return 0;
usage_count = mem_cgroup_count_swap_user(ent, &page);
}
+#endif
} else {
page = vm_normal_page(vma, addr, ptent);
if (!page || !page_mapped(page))
--
1.6.4
--
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-02-04 5:18 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-21 5:31 [PATCH -mmotm 0/8] memcg: move charge at task migration (21/Dec) Daisuke Nishimura
2009-12-21 5:32 ` [PATCH -mmotm 1/8] cgroup: introduce cancel_attach() Daisuke Nishimura
2009-12-21 5:32 ` [PATCH -mmotm 2/8] cgroup: introduce coalesce css_get() and css_put() Daisuke Nishimura
2009-12-21 5:33 ` [PATCH -mmotm 3/8] memcg: add interface to move charge at task migration Daisuke Nishimura
2009-12-21 7:00 ` KAMEZAWA Hiroyuki
2009-12-21 5:35 ` [PATCH -mmotm 4/8] memcg: move charges of anonymous page Daisuke Nishimura
2009-12-21 7:01 ` KAMEZAWA Hiroyuki
2009-12-23 0:26 ` Andrew Morton
2009-12-21 5:36 ` [PATCH -mmotm 5/8] memcg: improve performance in moving charge Daisuke Nishimura
2009-12-21 7:02 ` KAMEZAWA Hiroyuki
2009-12-21 5:37 ` [PATCH -mmotm 6/8] memcg: avoid oom during " Daisuke Nishimura
2009-12-21 7:03 ` KAMEZAWA Hiroyuki
2009-12-21 5:38 ` [PATCH -mmotm 7/8] memcg: move charges of anonymous swap Daisuke Nishimura
2009-12-21 7:04 ` KAMEZAWA Hiroyuki
2010-02-04 3:31 ` Andrew Morton
2010-02-04 5:09 ` Daisuke Nishimura [this message]
2010-02-04 5:27 ` KAMEZAWA Hiroyuki
2010-02-04 7:18 ` Paul Mundt
2010-02-04 7:44 ` KAMEZAWA Hiroyuki
2010-02-04 15:32 ` Balbir Singh
2010-02-05 0:38 ` Daisuke Nishimura
2010-02-05 0:54 ` KAMEZAWA Hiroyuki
2010-02-05 1:16 ` Paul Mundt
2010-03-09 23:13 ` Andrew Morton
2010-03-10 2:50 ` Daisuke Nishimura
2009-12-21 5:40 ` [PATCH -mmotm 8/8] memcg: improve performance in moving swap charge Daisuke Nishimura
2009-12-21 7:05 ` KAMEZAWA Hiroyuki
-- strict thread matches above, loose matches on Subject: below --
2009-12-14 6:17 [PATCH -mmotm 0/8] memcg: move charge at task migration (14/Dec) Daisuke Nishimura
2009-12-14 6:25 ` [PATCH -mmotm 7/8] memcg: move charges of anonymous swap Daisuke Nishimura
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=20100204140942.0ef6d7b1.nishimura@mxp.nes.nec.co.jp \
--to=nishimura@mxp.nes.nec.co.jp \
--cc=akpm@linux-foundation.org \
--cc=balbir@linux.vnet.ibm.com \
--cc=kamezawa.hiroyu@jp.fujitsu.com \
--cc=linux-mm@kvack.org \
--cc=lizf@cn.fujitsu.com \
--cc=menage@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