函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:Obtain the lock on page, remove all ptes and migrate the page* to the newly allocated page in newpage.

函数原型: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)

返回类型:int

参数:

类型参数名称
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  如果非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则返回:负ENOMEM
1176  如果page_count(page)恒等于1则
1178  ClearPageActive(page)
1179  ClearPageUnevictable(page)
1186  转到:out
1189  newpage等于get_new_page(page, private)
1190  如果非newpage则返回:负ENOMEM
1193  rc等于__unmap_and_move(page, newpage, force, mode)
1194  如果rc恒等于Return values from addresss_space_operations.migratepage():* - negative errno on page migration failure;* - zero on page migration success;set_page_owner_migrate_reason(newpage, reason)
1197  out :
1198  如果rc不等于负EAGAIN
1205  删除链表项
1212  如果此条件成立可能性大(为编译器优化)(!__PageMovable(page))则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  如果rc恒等于Return values from addresss_space_operations.migratepage():* - negative errno on page migration failure;* - zero on page migration success;
1223  Perform a free_page(), also freeing any swap cache associated with* this page if it is the last user of the page.
1224  如果reason恒等于MR_MEMORY_FAILURE
1233  否则
1234  如果rc不等于负EAGAIN
1243  否则__ClearPageIsolated(page)
1248  put_new :
1249  如果put_new_pageput_new_page(newpage, private)
1251  否则Perform a free_page(), also freeing any swap cache associated with* this page if it is the last user of the page.
1255  返回:rc
调用者
名称描述
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