Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:hugetlb_change_protection

Proto:unsigned long hugetlb_change_protection(struct vm_area_struct *vma, unsigned long address, unsigned long end, pgprot_t newprot)

Type:unsigned long

Parameter:

TypeParameterName
struct vm_area_struct *vma
unsigned longaddress
unsigned longend
pgprot_tnewprot
4450  mm = The address space we belong to.
4451  start = address
4454  h = hstate_vma(vma)
4455  pages = 0
4456  bool shared_pmd = false
4464  mmu_notifier_range_init( & range, MMU_NOTIFY_PROTECTION_VMA, 0, vma, mm, start, end)
4466  adjust_range_if_pmd_sharing_possible(vma, & start, & end)
4468  BUG_ON(address >= end)
4469  flush_cache_range(vma, start, end)
4471  mmu_notifier_invalidate_range_start( & range)
4472  i_mmap_lock_write(f_mapping)
4473  When address < end cycle
4475  ptep = huge_pte_offset(mm, address, huge_page_size(h))
4476  If Not ptep Then Continue
4478  ptl = huge_pte_lock(h, mm, ptep)
4479  If huge_pmd_unshare(mm, & address, ptep) Then
4480  pages++
4481  spin_unlock(ptl)
4482  shared_pmd = true
4483  Continue
4485  pte = huge_ptep_get(ptep)
4487  spin_unlock(ptl)
4488  Continue
4502  spin_unlock(ptl)
4503  Continue
4505  If Not huge_pte_none(pte) Then
4510  pte = arch_make_huge_pte(pte, vma, NULL, 0)
4512  pages++
4514  spin_unlock(ptl)
4523  If shared_pmd Then ARCHes with special requirements for evicting HUGETLB backing TLB entries can* implement this.(vma, start, end)
4525  Else ARCHes with special requirements for evicting HUGETLB backing TLB entries can* implement this.(vma, start, end)
4533  i_mmap_unlock_write(f_mapping)
4534  mmu_notifier_invalidate_range_end( & range)
4536  Return pages << order