函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\gup.c Create Date:2022-07-27 16:01:27
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:check_and_migrate_cma_pages

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

返回类型:long

参数:

类型参数名称
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 i小于nr_pages循环
1463  head等于compound_head(pages[i])
1469  step等于Returns the number of pages in this potentially compound page. pages[i]减head
1475  如果is_migrate_cma_page(head)则
1478  否则
1494  i加等于step
1497  如果非链表为空
1501 i小于nr_pages循环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  如果ret大于0且migrate_allow
1525  nr_pages等于ret
1526  drain_allow = true
1527  转到:check_again
1531  返回:ret
调用者
名称描述
__gup_longterm_locked__gup_longterm_locked() is a wrapper for __get_user_pages_locked which* allows us to process the FOLL_LONGTERM flag.