From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail137.messagelabs.com (mail137.messagelabs.com [216.82.249.19]) by kanga.kvack.org (Postfix) with SMTP id 866016B006A for ; Thu, 21 Jan 2010 18:03:21 -0500 (EST) Date: Fri, 22 Jan 2010 00:01:27 +0100 From: Andrea Arcangeli Subject: Re: [PATCH 22 of 30] pmd_trans_huge migrate bugcheck Message-ID: <20100121230127.GI5598@random.random> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: owner-linux-mm@kvack.org To: Christoph Lameter Cc: linux-mm@kvack.org, Marcelo Tosatti , Adam Litke , Avi Kivity , Izik Eidus , Hugh Dickins , Nick Piggin , Rik van Riel , Mel Gorman , Andi Kleen , Dave Hansen , Benjamin Herrenschmidt , Ingo Molnar , Mike Travis , KAMEZAWA Hiroyuki , Chris Wright , Andrew Morton List-ID: On Thu, Jan 21, 2010 at 02:40:41PM -0600, Christoph Lameter wrote: > On Thu, 21 Jan 2010, Andrea Arcangeli wrote: > > > From: Andrea Arcangeli > > > > No pmd_trans_huge should ever materialize in migration ptes areas, because > > try_to_unmap will split the hugepage before migration ptes are instantiated. > > try_to_unmap? How do you isolate the hugepages from the LRU? If you do > isolate the huge pages via a LRU and get a 2M page then the migration > logic has to be modified to be aware that huge pages may split during try_to_unmap. Good point, all we need to do is to add one split_huge_page before isolate_lru_page, the one in try_to_unmap isn't enough. Effectively I guess I can remove the one in try_to_unmap then and replace it with BUG_ON(TransHugePage(page)). Subject: pmd_trans_huge migrate From: Andrea Arcangeli No pmd_trans_huge should ever materialize in migration ptes areas, because we split the hugepage before migration ptes are instantiated. Signed-off-by: Andrea Arcangeli --- diff --git a/mm/migrate.c b/mm/migrate.c --- a/mm/migrate.c +++ b/mm/migrate.c @@ -99,6 +99,7 @@ static int remove_migration_pte(struct p goto out; pmd = pmd_offset(pud, addr); + VM_BUG_ON(pmd_trans_huge(*pmd)); if (!pmd_present(*pmd)) goto out; @@ -833,6 +834,9 @@ static int do_move_page_to_node_array(st !migrate_all) goto put_and_set; + if (unlikely(PageTransHuge(page))) + if (unlikely(split_huge_page(page))) + goto put_and_set; err = isolate_lru_page(page); if (!err) { list_add_tail(&page->lru, &pagelist); -- 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: email@kvack.org