Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:Obtain the lock on page, remove all ptes and migrate the page* to the newly allocated page in newpage.

Proto:static __attribute__((__noinline__)) int unmap_and_move(new_page_t get_new_page, free_page_t put_new_page, unsigned long private, struct page *page, int force, enum migrate_mode mode, enum migrate_reason reason)

Type:int

Parameter:

TypeParameterName
new_page_tget_new_page
free_page_tput_new_page
unsigned longprivate
struct page *page
intforce
enum migrate_modemode
enum migrate_reasonreason
1170  rc = Return values from addresss_space_operations.migratepage():* - negative errno on page migration failure;* - zero on page migration success;
1171  struct page * newpage = NULL
1173  If Not thp_migration_supported() && PageHuge() only returns true for hugetlbfs pages, but not for* normal or transparent huge pages.* PageTransHuge() returns true for both transparent huge and* hugetlbfs pages, but not normal pages. PageTransHuge() can only be Then Return -ENOMEM
1176  If page_count(page) == 1 Then
1178  ClearPageActive(page)
1179  ClearPageUnevictable(page)
1182  If Not PageMovable(page) Then __ClearPageIsolated(page)
1186  Go to out
1189  newpage = get_new_page(page, private)
1190  If Not newpage Then Return -ENOMEM
1193  rc = __unmap_and_move(page, newpage, force, mode)
1194  If rc == Return values from addresss_space_operations.migratepage():* - negative errno on page migration failure;* - zero on page migration success; Then set_page_owner_migrate_reason(newpage, reason)
1197  out :
1198  If rc != -EAGAIN Then
1205  deletes entry from list
1212  If Value is more likely to compile time(!__PageMovable(page)) Then mod_node_page_state(page_pgdat(page), Temporary isolated pages from anon lru + page_is_file_cache - should the page be on a file LRU or anon LRU?*@page: the page to test* Returns 1 if @page is page cache page backed by a regular filesystem,* or 0 if @page is anonymous, tmpfs or otherwise ram or swap backed, - hpage_nr_pages(page))
1222  If rc == Return values from addresss_space_operations.migratepage():* - negative errno on page migration failure;* - zero on page migration success; Then
1223  Perform a free_page(), also freeing any swap cache associated with* this page if it is the last user of the page.
1224  If reason == MR_MEMORY_FAILURE Then
1233  Else
1234  If rc != -EAGAIN Then
1243  Else __ClearPageIsolated(page)
1248  put_new :
1249  If put_new_page Then put_new_page(newpage, private)
1251  Else Perform a free_page(), also freeing any swap cache associated with* this page if it is the last user of the page.
1255  Return rc
Caller
NameDescribe
migrate_pagesmigrate_pages - migrate the pages specified in a list, to the free pages* supplied as the target for the page migration*@from: The list of pages to be migrated.*@get_new_page: The function used to allocate free pages to be used