From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753867Ab0D1Anw (ORCPT ); Tue, 27 Apr 2010 20:43:52 -0400 Received: from fgwmail7.fujitsu.co.jp ([192.51.44.37]:48881 "EHLO fgwmail7.fujitsu.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753620Ab0D1Anv (ORCPT ); Tue, 27 Apr 2010 20:43:51 -0400 X-SecurityPolicyCheck-FJ: OK by FujitsuOutboundMailChecker v1.3.1 Date: Wed, 28 Apr 2010 09:39:48 +0900 From: KAMEZAWA Hiroyuki To: Andrea Arcangeli Cc: Mel Gorman , Linux-MM , LKML , Minchan Kim , Christoph Lameter , Rik van Riel , Andrew Morton Subject: Re: [PATCH 3/3] mm,migration: Remove straggling migration PTEs when page tables are being moved after the VMA has already moved Message-Id: <20100428093948.c4e6faa1.kamezawa.hiroyu@jp.fujitsu.com> In-Reply-To: <20100427225852.GH8860@random.random> References: <1272403852-10479-1-git-send-email-mel@csn.ul.ie> <1272403852-10479-4-git-send-email-mel@csn.ul.ie> <20100427223004.GF8860@random.random> <20100427225852.GH8860@random.random> Organization: FUJITSU Co. LTD. X-Mailer: Sylpheed 3.0.2 (GTK+ 2.10.14; i686-pc-mingw32) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 28 Apr 2010 00:58:52 +0200 Andrea Arcangeli wrote: > On Wed, Apr 28, 2010 at 12:30:04AM +0200, Andrea Arcangeli wrote: > > I'll now evaluate the fix and see if I can find any other > > way to handle this. > > > I think a better fix for bug mentioned in patch 3, is like below. This > seems to work fine on aa.git with the old (stable) 2.6.33 anon-vma > code. Not sure if this also works with the new anon-vma code in > mainline but at first glance I think it should. At that point we > should be single threaded so it shouldn't matter if anon_vma is > temporary null. > > Then you've to re-evaluate the vma_adjust fixes for mainline-only in > patch 2 at the light of the below (I didn't check patch 2 in detail). > > Please try to reproduce with the below applied. > > ---- > Subject: fix race between shift_arg_pages and rmap_walk > > From: Andrea Arcangeli > > migrate.c requires rmap to be able to find all ptes mapping a page at > all times, otherwise the migration entry can be instantiated, but it > can't be removed if the second rmap_walk fails to find the page. > > So shift_arg_pages must run atomically with respect of rmap_walk, and > it's enough to run it under the anon_vma lock to make it atomic. > > And split_huge_page() will have the same requirements as migrate.c > already has. > > Signed-off-by: Andrea Arcangeli Seems nice. I'll test this but I think we need to take care of do_mremap(), too. And it's more complicated.... Thanks, -Kame