Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:zap_huge_pmd

Proto:int zap_huge_pmd(struct mmu_gather *tlb, struct vm_area_struct *vma, pmd_t *pmd, unsigned long addr)

Type:int

Parameter:

TypeParameterName
struct mmu_gather *tlb
struct vm_area_struct *vma
pmd_t *pmd
unsigned longaddr
1780  tlb_change_page_size(tlb, HPAGE_PMD_SIZE)
1782  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.
1783  If Not ptl Then Return 0
1791  orig_pmd = pmdp_huge_get_and_clear_full(mm, addr, pmd, we are in the middle of an operation to clear* a full mm and can make some optimizations)
1793  tlb_remove_pmd_tlb_entry(tlb, pmd, addr)
1794  If vma_is_dax(vma) Then
1795  If arch_needs_pgtable_deposit() Then zap_deposited_table(mm, pmd)
1797  spin_unlock(ptl)
1798  If is_huge_zero_pmd(orig_pmd) Then tlb_remove_page_size(tlb, Currently stuck as a macro due to indirect forward reference to* linux/mmzone.h's __section_mem_map_addr() definition:(orig_pmd), HPAGE_PMD_SIZE)
1800  Else if is_huge_zero_pmd(orig_pmd) Then
1801  zap_deposited_table(mm, pmd)
1802  spin_unlock(ptl)
1803  tlb_remove_page_size(tlb, Currently stuck as a macro due to indirect forward reference to* linux/mmzone.h's __section_mem_map_addr() definition:(orig_pmd), HPAGE_PMD_SIZE)
1804  Else
1805  struct page * page = NULL
1806  flush_needed = 1
1808  If pmd_present(orig_pmd) Then
1813  Else if thp_migration_supported() Then
1819  flush_needed = 0
1820  Else WARN_ONCE(1, "Non present huge pmd without pmd migration enabled!")
1823  If PageAnon(page) Then
1826  Else
1832  spin_unlock(ptl)
1833  If flush_needed Then tlb_remove_page_size(tlb, page, HPAGE_PMD_SIZE)
1836  Return 1