*参照元 [#ae8330d9] #backlinks *説明 [#m2c88b98] -パス: [[linux-4.4.1/mm/migrate.c]] -FIXME: これは何? --説明 **引数 [#p269081a] -struct page *newpage -- --[[linux-4.4.1/page]] -struct page *page -- --[[linux-4.4.1/page]] -enum migrate_mode mode -- --[[linux-4.4.1/migrate_mode]] **返り値 [#sfc6b4d5] -int -- **参考 [#ie84a2f8] *実装 [#tc8b39bc] /* * Move a page to a newly allocated page * The page is locked and all ptes have been successfully removed. * * The new page will have replaced the old page if this function * is successful. * * Return value: * < 0 - error code * MIGRATEPAGE_SUCCESS - success */ static int move_to_new_page(struct page *newpage, struct page *page, enum migrate_mode mode) { struct address_space *mapping; int rc; - --[[linux-4.4.1/address_space]] VM_BUG_ON_PAGE(!PageLocked(page), page); VM_BUG_ON_PAGE(!PageLocked(newpage), newpage); - --[[linux-4.4.1/VM_BUG_ON_PAGE()]] --[[linux-4.4.1/PageLocked()]] mapping = page_mapping(page); if (!mapping) rc = migrate_page(mapping, newpage, page, mode); - --[[linux-4.4.1/page_mapping()]] --[[linux-4.4.1/migrate_page()]] else if (mapping->a_ops->migratepage) /* * Most pages have a mapping and most filesystems provide a * migratepage callback. Anonymous pages are part of swap * space which also has its own migratepage callback. This * is the most common path for page migration. */ rc = mapping->a_ops->migratepage(mapping, newpage, page, mode); - --mapping->a_ops は const struct address_space_operations * 型 --[[linux-4.4.1/address_space_operations]] else rc = fallback_migrate_page(mapping, newpage, page, mode); - --[[linux-4.4.1/fallback_migrate_page()]] /* * When successful, old pagecache page->mapping must be cleared before * page is freed; but stats require that PageAnon be left as PageAnon. */ if (rc == MIGRATEPAGE_SUCCESS) { set_page_memcg(page, NULL); if (!PageAnon(page)) page->mapping = NULL; } - --[[linux-4.4.1/set_page_memcg()]] --[[linux-4.4.1/PageAnon()]] return rc; } *コメント [#t2e92344]