Re: Atomic operation for physically moving a page (for memory defragmentation)

From: IWAMOTO Toshihiro
Date: Wed Jun 23 2004 - 04:05:48 EST


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@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/