函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:Resolves the given address to a struct page, isolates it from the LRU and* puts it to the given pagelist

函数原型:static int add_page_for_migration(struct mm_struct *mm, unsigned long addr, int node, struct list_head *pagelist, bool migrate_all)

返回类型:int

参数:

类型参数名称
struct mm_struct *mm
unsigned longaddr
intnode
struct list_head *pagelist
boolmigrate_all
1529  lock for reading
1530  err等于负EFAULT
1531  vma等于Look up the first VMA which satisfies addr < vm_end, NULL if none.
1532  如果非vmaaddr小于Our start address within vm_mm. 或非Check if a vma is migratable 则转到:out
1536  follflags等于do get_page on page 按位或give error on hole if it would be zero
1537  page等于follow_page(vma, addr, follflags)
1539  err等于错误
1540  如果是错误则转到:out
1543  err等于负ENOENT
1544  如果非page则转到:out
1547  err等于0
1548  如果page_to_nid(page)恒等于node则转到:out_putpage
1551  err等于负EACCES
1552  如果page_mapcount(page)大于1且非migrate_all则转到:out_putpage
1555  如果PageHuge() only returns true for hugetlbfs pages, but not for normal or* transparent huge pages. See the PageTransHuge() documentation for more* details.
1556  如果PageHead(page)则
1558  err等于1
1560  否则
1563  head等于compound_head(page)
1564  err等于solate_lru_page - tries to isolate a page from its LRU list*@page: page to isolate from its LRU list* Isolates a @page from an LRU list, clears PageLRU and adjusts the* vmstat statistic corresponding to whatever LRU list the page was on.
1565  如果err则转到:out_putpage
1568  err等于1
1569  添加链表项
1570  mod_node_page_state(page_pgdat(head), 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(head))
1574  out_putpage :
1580  Perform a free_page(), also freeing any swap cache associated with* this page if it is the last user of the page.
1581  out :
1582  lease a read lock
1583  返回:err
调用者
名称描述
do_pages_moveMigrate an array of page address onto an array of nodes and fill* the corresponding array of status.