Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:insert_pfn_pmd

Proto:static void insert_pfn_pmd(struct vm_area_struct *vma, unsigned long addr, pmd_t *pmd, pfn_t pfn, pgprot_t prot, bool write, pgtable_t pgtable)

Type:void

Parameter:

TypeParameterName
struct vm_area_struct *vma
unsigned longaddr
pmd_t *pmd
pfn_tpfn
pgprot_tprot
boolwrite
pgtable_tpgtable
773  mm = The address space we belong to.
777  ptl = pmd_lock(mm, pmd)
778  If Not pmd_none( * pmd) Then
779  If write Then
780  If pmd_pfn( * pmd) != pfn_t_to_pfn(pfn) Then
782  Go to out_unlock
784  entry = pmd_mkyoung( * pmd)
790  Go to out_unlock
793  entry = pmd_mkhuge(pfn_t_pmd(pfn, prot))
794  If pfn_t_devmap(pfn) Then entry = pmd_mkdevmap(entry)
796  If write Then
797  entry = pmd_mkyoung(pmd_mkdirty(entry))
798  entry = maybe_pmd_mkwrite(entry, vma)
801  If pgtable Then
802  pgtable_trans_huge_deposit(mm, pmd, pgtable)
803  mm_inc_nr_ptes(mm)
804  pgtable = NULL
807  set_pmd_at(mm, addr, pmd, entry)
808  update_mmu_cache_pmd(vma, addr, pmd)
810  out_unlock :
811  spin_unlock(ptl)
812  If pgtable Then pte_free - free PTE-level user page table page*@mm: the mm_struct of the current context*@pte_page: the `struct page` representing the page table
Caller
NameDescribe
vmf_insert_pfn_pmd