Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:This function frees user-level page tables of a process.

Proto:void free_pgd_range(struct mmu_gather *tlb, unsigned long addr, unsigned long end, unsigned long floor, unsigned long ceiling)

Type:void

Parameter:

TypeParameterName
struct mmu_gather *tlb
unsigned longaddr
unsigned longend
unsigned longfloor
unsigned longceiling
359  addr &= PMD_MASK
360  If addr < floor Then
361  addr += PMD_SIZE
362  If Not addr Then Return
365  If ceiling Then
366  ceiling &= PMD_MASK
367  If Not ceiling Then Return
370  If end - 1 > ceiling - 1 Then end -= PMD_SIZE
372  If addr > end - 1 Then Return
378  tlb_change_page_size(tlb, PAGE_SIZE)
379  pgd = a shortcut to get a pgd_t in a given mm(mm, addr)
380  Do
381  next = When walking page tables, get the address of the next boundary,* or the end address of the range if that comes earlier. Although no* vma end wraps to 0, rounded up __boundary may wrap to 0 throughout.(addr, end)
382  If pgd_none_or_clear_bad(pgd) Then Continue
384  free_p4d_range(tlb, pgd, addr, next, floor, ceiling)
385  When pgd++, addr = next , addr != end cycle
Caller
NameDescribe
free_pgtables
shift_arg_pagesDuring bprm_mm_init(), we create a temporary stack at STACK_TOP_MAX. Once* the binfmt code determines where the new stack should reside, we shift it to* its final location. The process proceeds as follows:* 1) Use shift to calculate the new vma endpoints.