函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:__split_huge_pmd_locked

函数原型:static void __split_huge_pmd_locked(struct vm_area_struct *vma, pmd_t *pmd, unsigned long haddr, bool freeze)

返回类型:void

参数:

类型参数名称
struct vm_area_struct *vma
pmd_t *pmd
unsigned longhaddr
boolfreeze
2143  mm等于The address space we belong to.
2147  bool young, write, soft_dirty, pmd_migration = false
2151  VM_BUG_ON(haddr & ~HPAGE_PMD_MASK)
2152  VM_BUG_ON_VMA(Our start address within vm_mm. > haddr, vma)
2153  VM_BUG_ON_VMA(The first byte after our end addresswithin vm_mm. < haddr + HPAGE_PMD_SIZE, vma)
2154  VM_BUG_ON(!is_pmd_migration_entry( * pmd) && !pmd_trans_huge( * pmd) && !pmd_devmap( * pmd))
2157  Disable counters
2159  如果非vma_is_anonymous(vma)则
2160  _pmd等于pmdp_huge_clear_flush_notify(vma, haddr, pmd)
2165  如果arch_needs_pgtable_deposit()则zap_deposited_table(mm, pmd)
2167  如果vma_is_dax(vma)则返回
2169  page等于Currently stuck as a macro due to indirect forward reference to* linux/mmzone.h's __section_mem_map_addr() definition:(_pmd)
2170  如果非PageDirty(page)且pmd_dirty(_pmd)则Dirty a page
2172  如果非PageReferenced(page)且pmd_young(_pmd)则SetPageReferenced(page)
2174  page_remove_rmap - take down pte mapping from a page*@page: page to remove mapping from*@compound: uncharge the page as compound or small page* The caller needs to hold the pte lock.
2175  Perform a free_page(), also freeing any swap cache associated with* this page if it is the last user of the page.
2176  add_mm_counter(mm, Optimized variant when page is already known not to be PageAnon , - HPAGE_PMD_NR)
2177  返回
2178  否则如果is_huge_zero_pmd( * pmd)则
2188  返回:__split_huge_zero_page_pmd(vma, haddr, pmd)
2211  old_pmd等于pmdp_invalidate(vma, haddr, pmd)
2213  pmd_migration等于is_pmd_migration_entry(old_pmd)
2214  如果此条件成立可能性小(为编译器优化)(pmd_migration)则
2217  entry等于pmd_to_swp_entry(old_pmd)
2218  page等于pfn_to_page(Extract the `offset' field from a swp_entry_t. The swp_entry_t is in* arch-independent format)
2219  write等于is_write_migration_entry(entry)
2220  young = false
2221  soft_dirty等于pmd_swp_soft_dirty(old_pmd)
2222  否则
2223  page等于Currently stuck as a macro due to indirect forward reference to* linux/mmzone.h's __section_mem_map_addr() definition:(old_pmd)
2224  如果pmd_dirty(old_pmd)则SetPageDirty(page)
2226  write等于pmd_write(old_pmd)
2227  young等于pmd_young(old_pmd)
2228  soft_dirty等于pmd_soft_dirty(old_pmd)
2230  VM_BUG_ON_PAGE(!page_count(page), page)
2231  page_ref_add(page, HPAGE_PMD_NR - 1)
2237  pgtable等于 "address" argument so destroys page coloring of some arch
2238  pmd_populate(mm, & _pmd, pgtable)
2240 i小于HPAGE_PMD_NR循环
2247  如果freezepmd_migration
2253  否则
2256  如果非writeentry等于pte_wrprotect(entry)
2258  如果非youngentry等于pte_mkold(entry)
2260  如果soft_dirtyentry等于pte_mksoft_dirty(entry)
2263  pte等于pte_offset_map( & _pmd, addr)
2264  BUG_ON(!pte_none( * pte))
2265  set_pte_at(mm, addr, pte, entry)
2266  atomic_inc( & * If the page can be mapped to userspace, encodes the number * of times this page is referenced by a page table.)
2267  pte_unmap(pte)
2274  如果compound_mapcount(page)大于1且非TestSetPageDoubleMap(page)则
2275 i小于HPAGE_PMD_NR循环atomic_inc( & * If the page can be mapped to userspace, encodes the number * of times this page is referenced by a page table.)
2279  如果atomic_add_negative( - 1, compound_mapcount_ptr(page))则
2281  __dec_node_page_state(page, NR_ANON_THPS)
2282  如果TestClearPageDoubleMap(page)则
2289  smp_wmb()
2290  pmd_populate(mm, pmd, pgtable)
2292  如果freeze
2293 i小于HPAGE_PMD_NR循环
调用者
名称描述
__split_huge_pmd