Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

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

Proto:static struct page *follow_page_mask(struct vm_area_struct *vma, unsigned long address, unsigned int flags, struct follow_page_context *ctx)

Type:struct page

Parameter:

TypeParameterName
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  If Not IS_ERR(page) Then
521  BUG_ON(flags & do get_page on page )
522  Return page
525  pgd = a shortcut to get a pgd_t in a given mm(mm, address)
527  If 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) || Value for the false possibility is greater at compile time(pgd_bad( * pgd)) Then Return no_page_table(vma, flags)
530  If hugepages at page global directory. If arch support* hugepages at pgd level, they need to define this.( * pgd) Then
531  page = follow_huge_pgd(mm, address, pgd, flags)
532  If page Then Return page
534  Return no_page_table(vma, flags)
536  If is_hugepd(__hugepd(pgd_val( * pgd))) Then
537  page = follow_huge_pd(vma, address, __hugepd(pgd_val( * pgd)), flags, raditional i386 two-level paging structure:)
540  If page Then Return page
542  Return no_page_table(vma, flags)
545  Return follow_p4d_mask(vma, address, pgd, flags, ctx)
Caller
NameDescribe
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