函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\swap_state.c Create Date:2022-07-27 16:45:26
Last Modify:2020-03-17 22:02:06 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:swap_ra_info

函数原型:static void swap_ra_info(struct vm_fault *vmf, struct vma_swap_readahead *ra_info)

返回类型:void

参数:

类型参数名称
struct vm_fault *vmf
struct vma_swap_readahead *ra_info
643  vma等于Target VMA
654  max_win等于1左移min_t - return minimum of two values, using the specified type*@type: data type to use*@x: first value*@y: second value(unsignedint, READ_ONCE(How many pages do we try to swap or page in/out together? ), Avoid stack overflow, because we need to save part of page table )位
656  如果max_win恒等于1则
657  win等于1
658  返回
661  faddr等于Faulting virtual address
662  orig_pte等于pte等于pte_offset_map(Pointer to pmd entry matching* the 'address' , faddr)
663  entry等于Convert the arch-dependent pte representation of a swp_entry_t into an* arch-independent swp_entry_t.
664  如果此条件成立可能性小(为编译器优化)(non_swap_entry(entry))则
665  pte_unmap(orig_pte)
666  返回
669  fpfn等于PFN_DOWN(faddr)
670  ra_val等于Initial readahead hits is 4 to start up with a small window (vma)
671  pfn等于PFN_DOWN(SWAP_RA_ADDR(ra_val))
672  prev_win等于SWAP_RA_WIN(ra_val)
673  hits等于SWAP_RA_HITS(ra_val)
674  win等于win等于__swapin_nr_pages(pfn, fpfn, hits, max_win, prev_win)
676  atomic_long_set( & swap_readahead_info, SWAP_RA_VAL(faddr, win, 0))
679  如果win恒等于1则
680  pte_unmap(orig_pte)
681  返回
685  如果fpfn恒等于pfn加1则swap_ra_clamp_pfn(vma, faddr, fpfn, fpfn + win, & start, & end)
687  否则如果pfn恒等于fpfn加1则swap_ra_clamp_pfn(vma, faddr, fpfn - win + 1, fpfn + 1, & start, & end)
690  否则
691  left等于win减1的差除2
692  swap_ra_clamp_pfn(vma, faddr, fpfn - left, fpfn + win - left, & start, & end)
695  nr_pte等于endstart
696  offset等于fpfnstart
697  pte减等于offset
701  tpte等于ptes
702 pfn不等于end循环tpte自加等于pte自加
705  pte_unmap(orig_pte)
调用者
名称描述
swap_vma_readaheadswap_vma_readahead - swap in pages in hope we need them soon*@entry: swap entry of this memory*@gfp_mask: memory allocation flags*@vmf: fault information* Returns the struct page for entry and addr, after queueing swapin.* Primitive swap readahead code