Function report |
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 activity | Download SCCT | Chinese |
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:
Type | Parameter | Name |
---|---|---|
struct mmu_gather * | tlb | |
struct vm_area_struct * | vma | |
pmd_t * | pmd | |
unsigned long | addr |
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) |
1800 | Else if is_huge_zero_pmd(orig_pmd) Then |
1801 | zap_deposited_table(mm, pmd) |
1802 | spin_unlock(ptl) |
1804 | Else |
1806 | flush_needed = 1 |
1808 | If pmd_present(orig_pmd) Then |
1809 | page = Currently stuck as a macro due to indirect forward reference to* linux/mmzone.h's __section_mem_map_addr() definition:(orig_pmd) |
1811 | VM_BUG_ON_PAGE(page_mapcount(page) < 0, page) |
1812 | VM_BUG_ON_PAGE(!PageHead(page), page) |
1813 | Else if thp_migration_supported() Then |
1816 | VM_BUG_ON(!is_pmd_migration_entry(orig_pmd)) |
1817 | entry = pmd_to_swp_entry(orig_pmd) |
1818 | page = pfn_to_page(Extract the `offset' field from a swp_entry_t. The swp_entry_t is in* arch-independent format) |
1819 | flush_needed = 0 |
1820 | Else WARN_ONCE(1, "Non present huge pmd without pmd migration enabled!") |
1824 | zap_deposited_table(mm, pmd) |
1825 | add_mm_counter(mm, MM_ANONPAGES, - HPAGE_PMD_NR) |
1826 | Else |
1827 | If arch_needs_pgtable_deposit() Then zap_deposited_table(mm, pmd) |
1832 | spin_unlock(ptl) |
1833 | If flush_needed Then tlb_remove_page_size(tlb, page, HPAGE_PMD_SIZE) |
1836 | Return 1 |
Source code conversion tool public plug-in interface | X |
---|---|
Support c/c++/esqlc/java Oracle/Informix/Mysql Plug-in can realize: logical Report Code generation and batch code conversion |