函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:madvise_free_pte_range

函数原型:static int madvise_free_pte_range(pmd_t *pmd, unsigned long addr, unsigned long end, struct mm_walk *walk)

返回类型:int

参数:

类型参数名称
pmd_t *pmd
unsigned longaddr
unsigned longend
struct mm_walk *walk
560  tlb等于private
561  mm等于mm
562  vma等于vma
566  nr_swap等于0
569  next等于pmd_addr_end(addr, end)
570  如果pmd_trans_huge( * pmd)则如果Return true if we do MADV_FREE successfully on entire pmd page.* Otherwise, return false.
572  转到:next
574  如果This is a noop if Transparent Hugepage Support is not built into* the kernel则返回:0
577  tlb_change_page_size(tlb, PAGE_SIZE)
578  orig_pte等于pte等于pte_offset_map_lock(mm, pmd, addr, & ptl)
579  flush_tlb_batched_pending(mm)
580  A facility to provide lazy MMU batching()
581 addr不等于end循环
582  ptent等于pte
584  如果pte_none(ptent)则继续下一循环
591  如果非pte_present(ptent)则
595  如果non_swap_entry(entry)则继续下一循环
597  nr_swap自减
600  继续下一循环
603  page等于vm_normal_page -- This function gets the "struct page" associated with a pte.* "Special" mappings do not wish to be associated with a "struct page" (either* it doesn't exist, or it exists but they don't want to touch it). In this
604  如果非page则继续下一循环
613  如果page_mapcount(page)不等于1则转到:out
615  get_page(page)
617  put_page(page)
618  转到:out
621  如果split_huge_page(page)则
628  put_page(page)
629  pte等于pte_offset_map_lock(mm, pmd, addr, & ptl)
630  pte自减
631  addr减等于PAGE_SIZE
632  继续下一循环
635  VM_BUG_ON_PAGE(PageTransCompound returns true for both transparent huge pages* and hugetlbfs pages, so it should only be called when it's known* that hugetlbfs pages aren't involved., page)
637  如果PageSwapCache(page)或PageDirty(page)则
638  如果非Return true if the page was successfully locked则继续下一循环
644  如果page_mapcount(page)不等于1则
649  如果PageSwapCache(page)且非try_to_free_swap(page)则
668  ptent等于pte_mkold(ptent)
669  ptent等于pte_mkclean(ptent)
670  set_pte_at(mm, addr, pte, ptent)
673  mark_page_lazyfree - make an anon page lazyfree*@page: page to deactivate* mark_page_lazyfree() moves @page to the inactive file list.* This is done to accelerate the reclaim of @page.
675  out :
676  如果nr_swap
677  如果mm恒等于mmsync_mm_rss(mm)
680  add_mm_counter(mm, MM_SWAPENTS, nr_swap)
682  arch_leave_lazy_mmu_mode()
683  pte_unmap_unlock(orig_pte, ptl)
684  cond_resched()
685  :
686  返回:0