Re: [Lhms-devel] [PATCH 5/7] Direct Migration V5: remove_from_swap() to remove swap ptes

KAMEZAWA Hiroyuki
2005-11-30T11:29:27Z

Christoph Lameter wrote:
> Add remove_from_swap
>
> remove_from_swap() allows the restoration of the pte entries that existed
> before page migration occurred for anonymous pages by walking the reverse
> maps. This reduces swap use and establishes regular pte's without the need
> for page faults.
>

in migrate_page_copy()
==
ClearPageSwapCache(page);
ClearPageActive(page);
ClearPagePrivate(page);
set_page_private(page, 0);
page->mapping = NULL;
==
page->mapping turns to be NULL, when migration success.
> + if (newpage) {
> /* Successful migration. Return new page to LRU */
> + remove_from_swap(page);
> move_to_lru(newpage);
> -
When success, remove_from_swap(page) is called.

> +#ifdef CONFIG_MIGRATION
> +/*
> + * Remove an anonymous page from swap replacing the swap pte's
> + * through real pte's pointing to valid pages.
> + */
> +void remove_from_swap(struct page *page)
> +{
> + struct anon_vma *anon_vma;
> + struct vm_area_struct *vma;
> +
> + if (!PageAnon(page))
> + return;
> +
PageAnon(page) always 0.

remove_from_swap(newpage) is sane ?

-- Kame