Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\gup.c Create Date:2022-07-28 14:35:30
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:check_and_migrate_cma_pages

Proto:static long check_and_migrate_cma_pages(struct task_struct *tsk, struct mm_struct *mm, unsigned long start, unsigned long nr_pages, struct page **pages, struct vm_area_struct **vmas, unsigned int gup_flags)

Type:long

Parameter:

TypeParameterName
struct task_struct *tsk
struct mm_struct *mm
unsigned longstart
unsigned longnr_pages
struct page **pages
struct vm_area_struct **vmas
unsigned intgup_flags
1455  bool drain_allow = true
1456  bool migrate_allow = true
1457  LIST_HEAD(cma_page_list)
1458  ret = nr_pages
1460  check_again :
1461  When i < nr_pages cycle
1463  head = compound_head(pages[i])
1469  step = Returns the number of pages in this potentially compound page. - pages[i] - head
1475  If is_migrate_cma_page(head) Then
1478  Else
1494  i += step
1497  If Not list_empty - tests whether a list is empty*@head: the list to test. Then
1501  When i < nr_pages cycle put_page(pages[i])
1510  migrate_allow = false
1520  ret = __get_user_pages_locked(tsk, mm, start, nr_pages, pages, vmas, NULL, gup_flags)
1524  If ret > 0 && migrate_allow Then
1525  nr_pages = ret
1526  drain_allow = true
1527  Go to check_again
1531  Return ret
Caller
NameDescribe
__gup_longterm_locked__gup_longterm_locked() is a wrapper for __get_user_pages_locked which* allows us to process the FOLL_LONGTERM flag.