函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\migrate.c Create Date:2022-07-27 17:33:04
Last Modify:2022-05-20 09:53:13 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称: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)

返回类型:int

参数:

类型参数名称
struct page *newpage
struct page *page
enum migrate_modemode
931  rc等于负EAGAIN
932  is_lru等于非__PageMovable(page)
934  VM_BUG_ON_PAGE(!PageLocked(page), page)
935  VM_BUG_ON_PAGE(!PageLocked(newpage), newpage)
937  mapping等于page_mapping(page)
939  如果此条件成立可能性大(为编译器优化)(is_lru)则
940  如果非mappingrc等于Common logic to directly migrate a single LRU page suitable for* pages that do not use PagePrivate/PagePrivate2.* Pages are locked upon entry and exit.
942  否则如果migratepagerc等于migratepage(mapping, newpage, page, mode)
952  否则rc等于Default handling if a filesystem does not provide a migration function.
955  否则
960  VM_BUG_ON_PAGE(!PageIsolated(page), page)
961  如果非PageMovable(page)则
964  转到:out
967  rc等于migratepage(mapping, newpage, page, mode)
969  WARN_ON_ONCE(rc == Return values from addresss_space_operations.migratepage():* - negative errno on page migration failure;* - zero on page migration success; && !PageIsolated(page))
977  如果rc恒等于Return values from addresss_space_operations.migratepage():* - negative errno on page migration failure;* - zero on page migration success;
978  如果__PageMovable(page)则
993  如果非PageMappingFlags(page)则 See page-flags.h for PAGE_MAPPING_FLAGS = NULL
996  如果此条件成立可能性大(为编译器优化)(!is_zone_device_page(newpage))则flush_dcache_page(newpage)
1000  out :
1001  返回:rc
调用者
名称描述
__unmap_and_move
unmap_and_move_huge_pageCounterpart of unmap_and_move_page() for hugepage migration