Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\migrate.c Create Date:2022-07-28 15:58:57
Last Modify:2022-05-20 09:53:13 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name: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

Proto:static int move_to_new_page(struct page *newpage, struct page *page, enum migrate_mode mode)

Type:int

Parameter:

TypeParameterName
struct page *newpage
struct page *page
enum migrate_modemode
931  rc = -EAGAIN
932  is_lru = Not __PageMovable(page)
934  VM_BUG_ON_PAGE(!PageLocked(page), page)
935  VM_BUG_ON_PAGE(!PageLocked(newpage), newpage)
937  mapping = page_mapping(page)
939  If Value is more likely to compile time(is_lru) Then
940  If Not mapping Then rc = 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  Else if migratepage Then rc = migratepage(mapping, newpage, page, mode)
952  Else rc = Default handling if a filesystem does not provide a migration function.
955  Else
960  VM_BUG_ON_PAGE(!PageIsolated(page), page)
961  If Not PageMovable(page) Then
964  Go to 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  If rc == Return values from addresss_space_operations.migratepage():* - negative errno on page migration failure;* - zero on page migration success; Then
978  If __PageMovable(page) Then
993  If Not PageMappingFlags(page) Then See page-flags.h for PAGE_MAPPING_FLAGS = NULL
996  If Value is more likely to compile time(!is_zone_device_page(newpage)) Then flush_dcache_page(newpage)
1000  out :
1001  Return rc
Caller
NameDescribe
__unmap_and_move
unmap_and_move_huge_pageCounterpart of unmap_and_move_page() for hugepage migration