Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S265152AbUFWJEE (ORCPT ); Wed, 23 Jun 2004 05:04:04 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S265224AbUFWJEE (ORCPT ); Wed, 23 Jun 2004 05:04:04 -0400 Received: from sv1.valinux.co.jp ([210.128.90.2]:31649 "EHLO sv1.valinux.co.jp") by vger.kernel.org with ESMTP id S265152AbUFWJEC (ORCPT ); Wed, 23 Jun 2004 05:04:02 -0400 Date: Wed, 23 Jun 2004 18:04:01 +0900 From: IWAMOTO Toshihiro To: Dave Hansen Cc: Ashwin Rao , Valdis.Kletnieks@vt.edu, linux-kernel , linux-mm Subject: Re: Atomic operation for physically moving a page (for memory defragmentation) In-Reply-To: <1087619137.4921.93.camel@nighthawk> References: <20040619031536.61508.qmail@web10902.mail.yahoo.com> <1087619137.4921.93.camel@nighthawk> User-Agent: Wanderlust/2.10.1 (Watching The Wheels) SEMI/1.14.6 (Maruoka) FLIM/1.14.6 (Marutamachi) APEL/10.6 Emacs/21.3 (i386-pc-linux-gnu) MULE/5.0 (SAKAKI) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Message-Id: <20040623090401.09BFA70B63@sv1.valinux.co.jp> Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1086 Lines: 27 At Fri, 18 Jun 2004 21:25:38 -0700, Dave Hansen wrote: > I think what you really want to do is keep anybody else from making a > new pte to the page, once you've invalidated all of the existing ones, > right? > > Holding a lock_page() should do the trick. Anybody that goes any pulls > the page out of the page cache has to do a lock_page() and check > page->mapping before they can establish a pte to it, so you can stop > that. Since you're invalidating page->mapping before you move the page > (you *are* doing this, right?), it will end up working itself out. This isn't true unless the PG_uptodate bit of the page isn't cleared, and properly doing that isn't so simple. I'm planning to post a new version of my memory hotplug patch, but the page migration code currently doesn't work well with linux-2.6.7. -- IWAMOTO Toshihiro - 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/