From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965153AbWDNUNS (ORCPT ); Fri, 14 Apr 2006 16:13:18 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S965147AbWDNUNS (ORCPT ); Fri, 14 Apr 2006 16:13:18 -0400 Received: from omx2-ext.sgi.com ([192.48.171.19]:5816 "EHLO omx2.sgi.com") by vger.kernel.org with ESMTP id S965145AbWDNUNQ (ORCPT ); Fri, 14 Apr 2006 16:13:16 -0400 Date: Fri, 14 Apr 2006 13:12:39 -0700 (PDT) From: Christoph Lameter To: Andrew Morton cc: hugh@veritas.com, linux-kernel@vger.kernel.org, lee.schermerhorn@hp.com, linux-mm@kvack.org, taka@valinux.co.jp, marcelo.tosatti@cyclades.com, kamezawa.hiroyu@jp.fujitsu.com Subject: Re: Implement lookup_swap_cache for migration entries In-Reply-To: <20060414125320.72599c7e.akpm@osdl.org> Message-ID: References: <20060413235406.15398.42233.sendpatchset@schroedinger.engr.sgi.com> <20060413235416.15398.49978.sendpatchset@schroedinger.engr.sgi.com> <20060413171331.1752e21f.akpm@osdl.org> <20060413174232.57d02343.akpm@osdl.org> <20060413180159.0c01beb7.akpm@osdl.org> <20060413222921.2834d897.akpm@osdl.org> <20060414113104.72a5059b.akpm@osdl.org> <20060414121537.11134d26.akpm@osdl.org> <20060414125320.72599c7e.akpm@osdl.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 14 Apr 2006, Andrew Morton wrote: > So we're doing a get_page() on a random page which could be in any state - > it could be on the freelists, or in the per-cpu pages arrays, it could have > been reused for something else. Hmmm... Yes, Ahh! The tree_lock prohibits this sort of thing from happening to regular pages. Right.... Yuck this could be expensive to fix. We are holding the anon_vma lock while remapping migration ptes. So we could take the anonvma lock, check to see if the pte is still a migration pte if so then it cannot change and we can safely increase page count.