函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:swap_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

函数原型:static struct page *swap_vma_readahead(swp_entry_t fentry, gfp_t gfp_mask, struct vm_fault *vmf)

返回类型:struct page

参数:

类型参数名称
swp_entry_tfentry
gfp_tgfp_mask
struct vm_fault *vmf
726  vma等于Target VMA
732  struct vma_swap_readahead ra_info = {0, }
734  swap_ra_info(vmf, & ra_info)
735  如果win恒等于1则转到:skip
738  blk_start_plug( & plug)
739 i小于nr_pte循环
741  pentry等于pte
742  如果pte_none(pentry)则继续下一循环
744  如果pte_present(pentry)则继续下一循环
746  entry等于Convert the arch-dependent pte representation of a swp_entry_t into an* arch-independent swp_entry_t.
747  如果此条件成立可能性小(为编译器优化)(non_swap_entry(entry))则继续下一循环
749  page等于__read_swap_cache_async(entry, gfp_mask, vma, Faulting virtual address , & page_allocated)
751  如果非page则继续下一循环
753  如果page_allocated
754  swap_readpage(page, false)
755  如果i不等于offset
760  Perform a free_page(), also freeing any swap cache associated with* this page if it is the last user of the page.
762  blk_finish_plug( & plug)
763  lru_add_drain()
764  :
765  返回:Locate a page of swap in physical memory, reserving swap cache space* and reading the disk if it is not already cached.* A failure return means that either the page allocation failed or that* the swap entry is no longer in use.
调用者
名称描述
swapin_readaheadswapin_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.