Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:Walk a vmap address to the struct page it maps.

Proto:struct page *vmalloc_to_page(const void *vmalloc_addr)

Type:struct page

Parameter:

TypeParameterName
const void *vmalloc_addr
271  addr = vmalloc_addr
272  struct page * page = NULL
273  pgd = a shortcut which implies the use of the kernel's pgd, instead* of a process's(addr)
283  VIRTUAL_BUG_ON(!is_vmalloc_or_module_addr(vmalloc_addr))
285  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) Then Return NULL
287  p4d = p4d_offset(pgd, addr)
288  If The "p4d_xxx()" functions here are trivial for a folded two-level* setup: the pud is never bad, and a pud always exists (as it's folded* into the p4d entry) Then Return NULL
290  pud = pud_offset(p4d, addr)
300  WARN_ON_ONCE(pud_bad( * pud))
301  If The "pud_xxx()" functions here are trivial for a folded two-level* setup: the pmd is never bad, and a pmd always exists (as it's folded* into the pud entry) || pud_bad( * pud) Then Return NULL
303  pmd = pmd_offset(pud, addr)
304  WARN_ON_ONCE(pmd_bad( * pmd))
305  If pmd_none( * pmd) || pmd_bad( * pmd) Then Return NULL
308  ptep = pte_offset_map(pmd, addr)
309  pte = ptep
310  If pte_present(pte) Then page = pte_page(pte)
312  pte_unmap(ptep)
313  Return page
Caller
NameDescribe
__text_poke
relay_buf_faultault() vm_op implementation for relay file mapping.
vmalloc_to_pfnMap a vmalloc()-space virtual address to the physical page frame number.
aligned_vreadsmall helper routine , copy contents to buf from addr.* If the page is not present, fill zero.
aligned_vwrite
remap_vmalloc_range_partialmap_vmalloc_range_partial - map vmalloc pages to userspace*@vma: vma to cover*@uaddr: target user address to start at*@kaddr: virtual address of vmalloc kernel memory*@size: size of map area* Returns: 0 for success, -Exxx on failure* This function checks
swp_swapcountHow many references to @entry are currently swapped out?* This considers COUNT_CONTINUED so it returns exact answer.
add_swap_count_continuationadd_swap_count_continuation - called when a swap count is duplicated* beyond SWAP_MAP_MAX, it allocates a new page and links that to the entry's* page of the original vmalloc'ed swap_map, to hold the continuation count
swap_count_continuedswap_count_continued - when the original swap_map count is incremented* from SWAP_MAP_MAX, check if there is already a continuation page to carry* into, carry if so, or else fail until a new continuation page is allocated;* when the original swap_map
free_swap_count_continuations_swap_count_continuations - swapoff free all the continuation pages* appended to the swap_map, after swap_map is quiesced, before vfree'ing it.