migrate.c (c503c193db7d7ccc0c58b1ef694eaef331318149) migrate.c (ad2fa3717b74994a22519dbe045757135db00dbb)
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Memory Migration functionality - linux/mm/migrate.c
4 *
5 * Copyright (C) 2006 Silicon Graphics, Inc., Christoph Lameter
6 *
7 * Page migration was first developed in the context of the memory hotplug
8 * project. The main authors of the migration code are:

--- 612 unchanged lines hidden (view full) ---

621 ksm_migrate_page(newpage, page);
622 /*
623 * Please do not reorder this without considering how mm/ksm.c's
624 * get_ksm_page() depends upon ksm_migrate_page() and PageSwapCache().
625 */
626 if (PageSwapCache(page))
627 ClearPageSwapCache(page);
628 ClearPagePrivate(page);
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Memory Migration functionality - linux/mm/migrate.c
4 *
5 * Copyright (C) 2006 Silicon Graphics, Inc., Christoph Lameter
6 *
7 * Page migration was first developed in the context of the memory hotplug
8 * project. The main authors of the migration code are:

--- 612 unchanged lines hidden (view full) ---

621 ksm_migrate_page(newpage, page);
622 /*
623 * Please do not reorder this without considering how mm/ksm.c's
624 * get_ksm_page() depends upon ksm_migrate_page() and PageSwapCache().
625 */
626 if (PageSwapCache(page))
627 ClearPageSwapCache(page);
628 ClearPagePrivate(page);
629 set_page_private(page, 0);
630
629
630 /* page->private contains hugetlb specific flags */
631 if (!PageHuge(page))
632 set_page_private(page, 0);
633
631 /*
632 * If any waiters have accumulated on the new page then
633 * wake them up.
634 */
635 if (PageWriteback(newpage))
636 end_page_writeback(newpage);
637
638 /*

--- 1190 unchanged lines hidden (view full) ---

1829 mmap_read_lock(mm);
1830
1831 for (i = 0; i < nr_pages; i++) {
1832 unsigned long addr = (unsigned long)(*pages);
1833 struct vm_area_struct *vma;
1834 struct page *page;
1835 int err = -EFAULT;
1836
634 /*
635 * If any waiters have accumulated on the new page then
636 * wake them up.
637 */
638 if (PageWriteback(newpage))
639 end_page_writeback(newpage);
640
641 /*

--- 1190 unchanged lines hidden (view full) ---

1832 mmap_read_lock(mm);
1833
1834 for (i = 0; i < nr_pages; i++) {
1835 unsigned long addr = (unsigned long)(*pages);
1836 struct vm_area_struct *vma;
1837 struct page *page;
1838 int err = -EFAULT;
1839
1837 vma = find_vma(mm, addr);
1838 if (!vma || addr < vma->vm_start)
1840 vma = vma_lookup(mm, addr);
1841 if (!vma)
1839 goto set_status;
1840
1841 /* FOLL_DUMP to ignore special (like zero) pages */
1842 page = follow_page(vma, addr, FOLL_DUMP);
1843
1844 err = PTR_ERR(page);
1845 if (IS_ERR(page))
1846 goto set_status;

--- 1284 unchanged lines hidden ---
1842 goto set_status;
1843
1844 /* FOLL_DUMP to ignore special (like zero) pages */
1845 page = follow_page(vma, addr, FOLL_DUMP);
1846
1847 err = PTR_ERR(page);
1848 if (IS_ERR(page))
1849 goto set_status;

--- 1284 unchanged lines hidden ---