linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
To: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp>,
	linux-mm@kvack.org, balbir@linux.vnet.ibm.com, xemul@openvz.org,
	linux-kernel@vger.kernel.org
Subject: Re: [bad page] memcg: another bad page at page migration (2.6.26-rc5-mm3 + patch collection)
Date: Mon, 23 Jun 2008 20:21:11 +0900	[thread overview]
Message-ID: <20080623202111.f2c54e21.kamezawa.hiroyu@jp.fujitsu.com> (raw)
In-Reply-To: <20080623150817.628aef9f.kamezawa.hiroyu@jp.fujitsu.com>

On Mon, 23 Jun 2008 15:08:17 +0900
KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> wrote:

> On Mon, 23 Jun 2008 14:53:41 +0900
> Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp> wrote:
> 
> > Hi.
> > 
> > It seems the current -mm has been gradually stabilized,
> > but I encounter another bad page problem in my test(*1)
> > on 2.6.26-rc5-mm3 + patch collection(*2).
> > 
> > Compared to previous probrems fixed by the patch collection,
> > the frequency is law.
> > 
> > - 1 time in 1 hour running(1'st one was seen after 30 minutes)
> > - 3 times in 16 hours running(1'st one was seen after 4 hours)
> > - 10 times in 70 hours running(1'st one was seen after 8 hours)
> > 
> > All bad pages show similar message like below:
> > 
> Thank you. I'll dig this.
> 
> 
Here is one possibilty. But if your test doesn't migrate any shmem, 
I'll have to dig more ;)
Anyway, I'll schedule this patch.

-Kame
=
mem_cgroup_uncharge() against old page is done after radix-tree-replacement.
And there were special handling to ingore swap-cache page. But, shmem can
be swap-cache and file-cache at the same time. Chekcing PageSwapCache() is
not correct here. Check PageAnon() instead.

Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>

---
 mm/migrate.c |   11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

Index: test2-2.6.26-rc5-mm3/mm/migrate.c
===================================================================
--- test2-2.6.26-rc5-mm3.orig/mm/migrate.c
+++ test2-2.6.26-rc5-mm3/mm/migrate.c
@@ -330,7 +330,13 @@ static int migrate_page_move_mapping(str
 	__inc_zone_page_state(newpage, NR_FILE_PAGES);
 
 	spin_unlock_irq(&mapping->tree_lock);
-	if (!PageSwapCache(newpage))
+
+	/*
+	 * The page is removed from radix-tree implicitly.
+	 * We uncharge it here but swap cache of anonymous page should be
+	 * uncharged by mem_cgroup_ucharge_page().
+	 */
+	if (!PageAnon(newpage))
 		mem_cgroup_uncharge_cache_page(page);
 
 	return 0;
@@ -379,7 +385,8 @@ static void migrate_page_copy(struct pag
 		/*
 		 * SwapCache is removed implicitly. Uncharge against swapcache
 		 * should be called after ClearPageSwapCache() because
-		 * mem_cgroup_uncharge_page checks the flag.
+		 * mem_cgroup_uncharge_page checks the flag. shmem's swap cache
+		 * is uncharged before here.
 		 */
 		mem_cgroup_uncharge_page(page);
 	}

--
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:[~2008-06-23 11:21 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-23  5:53 Daisuke Nishimura
2008-06-23  6:08 ` KAMEZAWA Hiroyuki
2008-06-23 11:21   ` KAMEZAWA Hiroyuki [this message]
2008-06-23 11:44     ` Daisuke Nishimura
2008-06-24  1:37       ` Daisuke Nishimura
2008-06-24  3:22         ` KAMEZAWA Hiroyuki
2008-06-24  3:26           ` KAMEZAWA Hiroyuki
2008-06-24  5:51 ` [PATCH] memcg: end migration fix (was [bad page] memcg: another bad page at page migration (2.6.26-rc5-mm3 + patch collection)) KAMEZAWA Hiroyuki
2008-06-24  7:19   ` Daisuke Nishimura
2008-06-24  7:30     ` KAMEZAWA Hiroyuki
2008-06-24  7:27   ` Balbir Singh

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=20080623202111.f2c54e21.kamezawa.hiroyu@jp.fujitsu.com \
    --to=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=balbir@linux.vnet.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=nishimura@mxp.nes.nec.co.jp \
    --cc=xemul@openvz.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