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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




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

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux