From mboxrd@z Thu Jan 1 00:00:00 1970 Date: Wed, 23 Jun 2004 18:04:01 +0900 From: IWAMOTO Toshihiro 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> 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: owner-linux-mm@kvack.org Return-Path: To: Dave Hansen Cc: Ashwin Rao , Valdis.Kletnieks@vt.edu, linux-kernel , linux-mm List-ID: 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, 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: aart@kvack.org