函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:madvise_cold_or_pageout_pte_range

函数原型:static int madvise_cold_or_pageout_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
304  private等于private
305  tlb等于tlb
306  pageout等于pageout
307  mm等于mm
308  vma等于vma
311  struct page * page = NULL
312  LIST_HEAD(page_list)
314  如果fatal_signal_pending(当前进程)则返回:负EINTR
318  如果pmd_trans_huge( * pmd)则
320  next等于pmd_addr_end(addr, end)
322  tlb_change_page_size(tlb, HPAGE_PMD_SIZE)
323  ptl等于mmap_sem must be held on entry
324  如果非ptl则返回:0
327  orig_pmd等于pmd
328  如果is_huge_zero_pmd(orig_pmd)则转到:huge_unlock
334  转到:huge_unlock
337  page等于Currently stuck as a macro due to indirect forward reference to* linux/mmzone.h's __section_mem_map_addr() definition:(orig_pmd)
338  如果nextaddr不等于HPAGE_PMD_SIZE
341  如果page_mapcount(page)不等于1则转到:huge_unlock
344  get_page(page)
347  err等于split_huge_page(page)
349  put_page(page)
350  如果非err则转到:regular_page
352  返回:0
355  如果pmd_young(orig_pmd)则
363  ClearPageReferenced(page)
364  test_and_clear_page_young(page)
365  如果pageout
372  否则deactivate_page - deactivate a page*@page: page to deactivate* deactivate_page() moves @page to the inactive list if @page was on the active* list and was not an unevictable page. This is done to accelerate the reclaim* of @page.
374  huge_unlock :
375  自旋锁解锁
376  如果pageoutreclaim_pages( & page_list)
378  返回:0
381  如果This is a noop if Transparent Hugepage Support is not built into* the kernel则返回:0
383  regular_page :
385  tlb_change_page_size(tlb, PAGE_SIZE)
386  orig_pte等于pte等于pte_offset_map_lock(The address space we belong to. , pmd, addr, & ptl)
387  flush_tlb_batched_pending(mm)
388  A facility to provide lazy MMU batching()
389 addr小于end循环
390  ptent等于pte
392  如果pte_none(ptent)则继续下一循环
395  如果非pte_present(ptent)则继续下一循环
398  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
399  如果非page则继续下一循环
407  如果page_mapcount(page)不等于1则退出
409  get_page(page)
411  put_page(page)
412  退出
415  如果split_huge_page(page)则
422  put_page(page)
423  pte等于pte_offset_map_lock(mm, pmd, addr, & ptl)
424  pte自减
425  addr减等于PAGE_SIZE
426  继续下一循环
429  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)
431  如果pte_young(ptent)则
434  ptent等于pte_mkold(ptent)
435  set_pte_at(mm, addr, pte, ptent)
445  ClearPageReferenced(page)
446  test_and_clear_page_young(page)
447  如果pageout
454  否则deactivate_page - deactivate a page*@page: page to deactivate* deactivate_page() moves @page to the inactive list if @page was on the active* list and was not an unevictable page. This is done to accelerate the reclaim* of @page.
458  arch_leave_lazy_mmu_mode()
459  pte_unmap_unlock(orig_pte, ptl)
460  如果pageoutreclaim_pages( & page_list)
462  cond_resched()
464  返回:0