public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [RFC] some page can't be migrated
@ 2008-01-23  6:22 Shaohua Li
  2008-01-25  3:03 ` Nick Piggin
  2008-01-25  3:37 ` Christoph Lameter
  0 siblings, 2 replies; 18+ messages in thread
From: Shaohua Li @ 2008-01-23  6:22 UTC (permalink / raw)
  To: lkml; +Cc: Andrew Morton, clameter

Anonymous page might have fs-private metadata, the page is truncated. As
the page hasn't mapping, page migration refuse to migrate the page. It
appears the page is only freed in page reclaim and if zone watermark is
low, the page is never freed, as a result migration always fail. I
thought we could free the metadata so such page can be freed in
migration and make migration more reliable?

Thanks,
Shaohua

diff --git a/mm/migrate.c b/mm/migrate.c
index 6a207e8..6bc38f7 100644
--- a/mm/migrate.c
+++ b/mm/migrate.c
@@ -633,6 +633,17 @@ static int unmap_and_move(new_page_t get_new_page, unsigned long private,
 			goto unlock;
 		wait_on_page_writeback(page);
 	}
+
+	/*
+	 * See truncate_complete_page(). Anonymous page might have
+	 * fs-private metadata, the page is truncated. Such page can't be
+	 * migrated. Try to free metadata, so the page can be freed.
+	 */
+	if (!page->mapping && !PageAnon(page) && PagePrivate(page)) {
+		try_to_release_page(page, GFP_KERNEL);
+		goto unlock;
+	}
+
 	/*
 	 * By try_to_unmap(), page->mapcount goes down to 0 here. In this case,
 	 * we cannot notice that anon_vma is freed while we migrates a page.



^ permalink raw reply related	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2008-01-28 23:24 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-01-23  6:22 [RFC] some page can't be migrated Shaohua Li
2008-01-25  3:03 ` Nick Piggin
2008-01-25  3:09   ` Christoph Lameter
2008-01-25  3:09   ` Shaohua Li
2008-01-25  3:12     ` Christoph Lameter
2008-01-25  3:18       ` Shaohua Li
2008-01-25  5:20     ` Nick Piggin
2008-01-25  3:37 ` Christoph Lameter
2008-01-25  3:59   ` Shaohua Li
2008-01-25  4:01     ` Christoph Lameter
2008-01-25  4:17       ` Nick Piggin
2008-01-25  4:42         ` Christoph Lameter
2008-01-25  6:03         ` Shaohua Li
2008-01-27  6:03           ` Andrew Morton
2008-01-28  1:43             ` Nick Piggin
2008-01-28  1:48               ` Shaohua Li
2008-01-28 19:09             ` Christoph Lameter
2008-01-28 23:17             ` Christoph Lameter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox