函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:__collapse_huge_page_isolate

函数原型:static int __collapse_huge_page_isolate(struct vm_area_struct *vma, unsigned long address, pte_t *pte)

返回类型:int

参数:

类型参数名称
struct vm_area_struct *vma
unsigned longaddress
pte_t *pte
536  struct page * page = NULL
538  none_or_zero等于0, result等于0, referenced等于0
539  bool writable = false
541 _pte小于pteHPAGE_PMD_NR循环
543  pteval等于_pte
548  继续下一循环
549  否则
551  转到:out
554  如果非pte_present(pteval)则
556  转到:out
558  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
560  result等于SCAN_PAGE_NULL
561  转到:out
565  如果PageCompound(page)则
567  转到:out
570  VM_BUG_ON_PAGE(!PageAnon(page), page)
579  result等于SCAN_PAGE_LOCK
580  转到:out
588  如果page_count(page)不等于1加PageSwapCache(page)则
590  result等于SCAN_PAGE_COUNT
591  转到:out
593  如果pte_write(pteval)则
594  writable = true
595  否则
615  转到:out
617  inc_node_page_state(page, Temporary isolated pages from anon lru + page_is_file_cache - should the page be on a file LRU or anon LRU?*@page: the page to test* Returns 1 if @page is page cache page backed by a regular filesystem,* or 0 if @page is anonymous, tmpfs or otherwise ram or swap backed)
619  VM_BUG_ON_PAGE(!PageLocked(page), page)
620  VM_BUG_ON_PAGE(PageLRU(page), page)
623  如果pte_young(pteval)或page_is_young(page)或PageReferenced(page)或mmu_notifier_test_young(The address space we belong to. , address)则referenced自加
628  如果此条件成立可能性大(为编译器优化)(writable)则
630  result等于SCAN_SUCCEED
633  返回:1
635  否则
636  result等于SCAN_PAGE_RO
639  out :
640  release_pte_pages(pte, _pte)
641  trace_mm_collapse_huge_page_isolate(page, none_or_zero, referenced, writable, result)
643  返回:0
调用者
名称描述
collapse_huge_page