*参照元 [#lb6c7e22] #backlinks *説明 [#j2eff9af] -パス: [[linux-4.4.1/mm/migrate.c]] -FIXME: これは何? --説明 **引数 [#x3b38974] -struct page *newpage -- --[[linux-4.4.1/page]] struct page *page -struct page *page -- **返り値 [#r4074987] -void **参考 [#ic80d0c1] *実装 [#wdfd5f0d] /* * Copy the page to its new location */ void migrate_page_copy(struct page *newpage, struct page *page) { int cpupid; if (PageHuge(page) || PageTransHuge(page)) copy_huge_page(newpage, page); else copy_highpage(newpage, page); - --[[linux-4.4.1/PageHuge()]] --[[linux-4.4.1/PageTransHuge()]] --[[linux-4.4.1/copy_huge_page()]] --[[linux-4.4.1/copy_highpage()]] if (PageError(page)) SetPageError(newpage); if (PageReferenced(page)) SetPageReferenced(newpage); if (PageUptodate(page)) SetPageUptodate(newpage); - --[[linux-4.4.1/PageError()]] --[[linux-4.4.1/SetPageError()]] --[[linux-4.4.1/PageReferenced()]] --[[linux-4.4.1/SetPageReferenced()]] --[[linux-4.4.1/PageUptodate()]] --[[linux-4.4.1/SetPageUptodate()]] if (TestClearPageActive(page)) { VM_BUG_ON_PAGE(PageUnevictable(page), page); SetPageActive(newpage); } else if (TestClearPageUnevictable(page)) SetPageUnevictable(newpage); - --[[linux-4.4.1/TestClearPageActive()]] --[[linux-4.4.1/VM_BUG_ON_PAGE()]] --[[linux-4.4.1/PageUnevictable()]] --[[linux-4.4.1/SetPageActive()]] --[[linux-4.4.1/TestClearPageUnevictable()]] --[[linux-4.4.1/SetPageUnevictable()]] if (PageChecked(page)) SetPageChecked(newpage); if (PageMappedToDisk(page)) SetPageMappedToDisk(newpage); - --[[linux-4.4.1/PageChecked()]] --[[linux-4.4.1/SetPageChecked()]] --[[linux-4.4.1/PageMappedToDisk()]] --[[linux-4.4.1/SetPageMappedToDisk()]] /* Move dirty on pages not done by migrate_page_move_mapping() */ if (PageDirty(page)) SetPageDirty(newpage); if (page_is_young(page)) set_page_young(newpage); if (page_is_idle(page)) set_page_idle(newpage); - --[[linux-4.4.1/PageDirty()]] --[[linux-4.4.1/SetPageDirty()]] --[[linux-4.4.1/page_is_young()]] --[[linux-4.4.1/set_page_young()]] --[[linux-4.4.1/page_is_idle()]] --[[linux-4.4.1/set_page_idle()]] /* * Copy NUMA information to the new page, to prevent over-eager * future migrations of this same page. */ cpupid = page_cpupid_xchg_last(page, -1); page_cpupid_xchg_last(newpage, cpupid); ksm_migrate_page(newpage, page); - --[[linux-4.4.1/page_cpupid_xchg_last()]] --[[linux-4.4.1/ksm_migrate_page()]] /* * Please do not reorder this without considering how mm/ksm.c's * get_ksm_page() depends upon ksm_migrate_page() and PageSwapCache(). */ if (PageSwapCache(page)) ClearPageSwapCache(page); ClearPagePrivate(page); set_page_private(page, 0); - --[[linux-4.4.1/PageSwapCache()]] --[[linux-4.4.1/ClearPageSwapCache()]] --[[linux-4.4.1/ClearPagePrivate()]] --[[linux-4.4.1/set_page_private()]] /* * If any waiters have accumulated on the new page then * wake them up. */ if (PageWriteback(newpage)) end_page_writeback(newpage); - --[[linux-4.4.1/PageWriteback()]] --[[linux-4.4.1/end_page_writeback()]] } *コメント [#n2fb2543]