函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:llow_page_mask - look up a page descriptor from a user-virtual address*@vma: vm_area_struct mapping @address*@address: virtual address to look up*@flags: flags modifying lookup behaviour*@ctx: contains dev_pagemap for %ZONE_DEVICE memory pinning and a*

函数原型:static struct page *follow_page_mask(struct vm_area_struct *vma, unsigned long address, unsigned int flags, struct follow_page_context *ctx)

返回类型:struct page

参数:

类型参数名称
struct vm_area_struct *vma
unsigned longaddress
unsigned intflags
struct follow_page_context *ctx
514  mm等于The address space we belong to.
516  page_mask等于0
519  page等于follow_huge_addr(mm, address, flags & check pte is writable )
520  如果非是错误
521  BUG_ON(flags & do get_page on page )
522  返回:page
525  pgd等于a shortcut to get a pgd_t in a given mm(mm, address)
527  如果The "pgd_xxx()" functions here are trivial for a folded two-level* setup: the p4d is never bad, and a p4d always exists (as it's folded* into the pgd entry)此条件成立可能性小(为编译器优化)(pgd_bad( * pgd))则返回:no_page_table(vma, flags)
530  如果hugepages at page global directory. If arch support* hugepages at pgd level, they need to define this.( * pgd)则
531  page等于follow_huge_pgd(mm, address, pgd, flags)
532  如果page则返回:page
534  返回:no_page_table(vma, flags)
536  如果is_hugepd(__hugepd(pgd_val( * pgd)))则
537  page等于follow_huge_pd(vma, address, __hugepd(pgd_val( * pgd)), flags, raditional i386 two-level paging structure:)
540  如果page则返回:page
542  返回:no_page_table(vma, flags)
545  返回:follow_p4d_mask(vma, address, pgd, flags, ctx)
调用者
名称描述
follow_page
__get_user_pages__get_user_pages() - pin user pages in memory*@tsk: task_struct of target task*@mm: mm_struct of target mm*@start: starting user address*@nr_pages: number of pages from start to pin*@gup_flags: flags modifying pin behaviour