函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:hugetlb_change_protection

函数原型:unsigned long hugetlb_change_protection(struct vm_area_struct *vma, unsigned long address, unsigned long end, pgprot_t newprot)

返回类型:unsigned long

参数:

类型参数名称
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 address小于end循环
4475  ptep等于huge_pte_offset(mm, address, huge_page_size(h))
4476  如果非ptep则继续下一循环
4478  ptl等于huge_pte_lock(h, mm, ptep)
4479  如果huge_pmd_unshare(mm, & address, ptep)则
4480  pages自加
4482  shared_pmd = true
4483  继续下一循环
4485  pte等于huge_ptep_get(ptep)
4488  继续下一循环
4493  如果is_write_migration_entry(entry)则
4503  继续下一循环
4505  如果非huge_pte_none(pte)则
4510  pte等于arch_make_huge_pte(pte, vma, NULL, 0)
4512  pages自加
4514  自旋锁解锁
4523  如果shared_pmdARCHes with special requirements for evicting HUGETLB backing TLB entries can* implement this.(vma, start, end)
4525  否则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  返回:pages左移order
调用者
名称描述
change_protection