Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:Returns* - 0 if PMD could not be locked* - 1 if PMD was locked but protections unchange and TLB flush unnecessary* - HPAGE_PMD_NR is protections changed and TLB flush necessary

Proto:int change_huge_pmd(struct vm_area_struct *vma, pmd_t *pmd, unsigned long addr, pgprot_t newprot, int prot_numa)

Type:int

Parameter:

TypeParameterName
struct vm_area_struct *vma
pmd_t *pmd
unsigned longaddr
pgprot_tnewprot
intprot_numa
1928  mm = The address space we belong to.
1934  ptl = Returns page table lock pointer if a given pmd maps a thp, NULL otherwise.* Note that if it returns page table lock pointer, this routine returns without* unlocking page table lock. So callers must unlock it.
1935  If Not ptl Then Return 0
1938  preserve_write = prot_numa && pmd_write( * pmd)
1939  ret = 1
1967  If prot_numa && is_huge_zero_pmd( * pmd) Then Go to unlock
1970  If prot_numa && pmd_protnone( * pmd) Then Go to unlock
1994  entry = pmdp_invalidate(vma, addr, pmd)
1996  entry = pmd_modify(entry, newprot)
1997  If preserve_write Then entry = pmd_mk_savedwrite(entry)
1999  ret = HPAGE_PMD_NR
2000  set_pmd_at(mm, addr, pmd, entry)
2001  BUG_ON(vma_is_anonymous(vma) && !preserve_write && pmd_write(entry))
2002  unlock :
2003  spin_unlock(ptl)
2004  Return ret