Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:Resolves the given address to a struct page, isolates it from the LRU and* puts it to the given pagelist

Proto:static int add_page_for_migration(struct mm_struct *mm, unsigned long addr, int node, struct list_head *pagelist, bool migrate_all)

Type:int

Parameter:

TypeParameterName
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  If Not vma || addr < Our start address within vm_mm. || Not Check if a vma is migratable Then Go to 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 = PTR_ERR(page)
1540  If IS_ERR(page) Then Go to out
1543  err = -ENOENT
1544  If Not page Then Go to out
1547  err = 0
1548  If page_to_nid(page) == node Then Go to out_putpage
1551  err = -EACCES
1552  If page_mapcount(page) > 1 && Not migrate_all Then Go to out_putpage
1555  If PageHuge() only returns true for hugetlbfs pages, but not for normal or* transparent huge pages. See the PageTransHuge() documentation for more* details. Then
1556  If PageHead(page) Then
1558  err = 1
1560  Else
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  If err Then Go to out_putpage
1568  err = 1
1569  list_add_tail - add a new entry*@new: new entry to be added*@head: list head to add it before* Insert a new entry before the specified head.* This is useful for implementing queues.
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  Return err
Caller
NameDescribe
do_pages_moveMigrate an array of page address onto an array of nodes and fill* the corresponding array of status.