Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755458Ab0DUPA7 (ORCPT ); Wed, 21 Apr 2010 11:00:59 -0400 Received: from gir.skynet.ie ([193.1.99.77]:37333 "EHLO gir.skynet.ie" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754018Ab0DUPA6 (ORCPT ); Wed, 21 Apr 2010 11:00:58 -0400 Date: Wed, 21 Apr 2010 16:00:38 +0100 From: Mel Gorman To: Christoph Lameter Cc: Andrew Morton , Andrea Arcangeli , Adam Litke , Avi Kivity , David Rientjes , Minchan Kim , KAMEZAWA Hiroyuki , KOSAKI Motohiro , Rik van Riel , linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH 04/14] mm,migration: Allow the migration of PageSwapCache pages Message-ID: <20100421150037.GJ30306@csn.ul.ie> References: <1271797276-31358-1-git-send-email-mel@csn.ul.ie> <1271797276-31358-5-git-send-email-mel@csn.ul.ie> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17+20080114 (2008-01-14) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1985 Lines: 67 On Wed, Apr 21, 2010 at 09:30:20AM -0500, Christoph Lameter wrote: > On Tue, 20 Apr 2010, Mel Gorman wrote: > > > @@ -520,10 +521,12 @@ static int move_to_new_page(struct page *newpage, struct page *page) > > else > > rc = fallback_migrate_page(mapping, newpage, page); > > > > - if (!rc) > > - remove_migration_ptes(page, newpage); > > - else > > + if (rc) { > > newpage->mapping = NULL; > > + } else { > > + if (remap_swapcache) > > + remove_migration_ptes(page, newpage); > > + } > > You are going to keep the migration ptes after the page has been unlocked? Yes, because it's not known if the anon_vma for the unmapped swapcache page still exists or not. Now, a bug has been reported where a migration PTE is found where the page is not locked. I'm trying to determine if it's the same page or not but the problem takes ages to reproduce. > Or is remap_swapcache true if its not a swapcache page? > > Maybe you meant > > if (!remap_swapcache) > > ? > No, remap_swapcache could just be called "remap". If it's 0, it's considered unsafe to remap the page. > > unlock_page(newpage); > > > > > > > skip_unmap: > > if (!page_mapped(page)) > > - rc = move_to_new_page(newpage, page); > > + rc = move_to_new_page(newpage, page, remap_swapcache); > > > > - if (rc) > > + if (rc && remap_swapcache) > > remove_migration_ptes(page, page); > > rcu_unlock: > > > > Looks like you meant !remap_swapcache > If remap_swapcache is 1, the anon_vma is valid (or irrelevant because it's a file) and it's safe to remap the page by removing the migration PTEs. -- Mel Gorman Part-time Phd Student Linux Technology Center University of Limerick IBM Dublin Software Lab -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/