Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

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

Proto:int migrate_pages(struct list_head *from, new_page_t get_new_page, free_page_t put_new_page, unsigned long private, enum migrate_mode mode, int reason)

Type:int

Parameter:

TypeParameterName
struct list_head *from
new_page_tget_new_page
free_page_tput_new_page
unsigned longprivate
enum migrate_modemode
intreason
1399  retry = 1
1400  nr_failed = 0
1401  nr_succeeded = 0
1402  pass = 0
1405  swapwrite = flags & Allowed to write to swap
1408  If Not swapwrite Then flags |= Allowed to write to swap
1411  When pass < 10 && retry cycle
1412  retry = 0
1415  retry :
1416  cond_resched()
1418  If PageHuge() only returns true for hugetlbfs pages, but not for normal or* transparent huge pages. See the PageTransHuge() documentation for more* details. Then rc = Counterpart of unmap_and_move_page() for hugepage migration
1422  Else rc = Obtain the lock on page, remove all ptes and migrate the page* to the newly allocated page in newpage.
1428  Case rc == -ENOMEM
1449  nr_failed++
1450  Go to out
1451  Case rc == -EAGAIN
1452  retry++
1453  Break
1455  nr_succeeded++
1456  Break
1457  Default
1464  nr_failed++
1465  Break
1469  nr_failed += retry
1470  rc = nr_failed
1471  out :
1472  If nr_succeeded Then count_vm_events(PGMIGRATE_SUCCESS, nr_succeeded)
1474  If nr_failed Then count_vm_events(PGMIGRATE_FAIL, nr_failed)
1476  trace_mm_migrate_pages(nr_succeeded, nr_failed, mode, reason)
1478  If Not swapwrite Then flags &= ~Allowed to write to swap
1481  Return rc
Caller
NameDescribe
migrate_to_nodeMigrate pages from one node to a target node.* Returns error or the number of pages not migrated.
do_mbind
do_move_pages_to_node
soft_offline_huge_page
__soft_offline_page
check_and_migrate_cma_pages