函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

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

函数原型:struct page *swap_cluster_readahead(swp_entry_t entry, gfp_t gfp_mask, struct vm_fault *vmf)

返回类型:struct page

参数:

类型参数名称
swp_entry_tentry
gfp_tgfp_mask
struct vm_fault *vmf
543  entry_offset等于Extract the `offset' field from a swp_entry_t. The swp_entry_t is in* arch-independent format
544  offset等于entry_offset
547  si等于swp_swap_info(entry)
549  bool do_poll = true, page_allocated
550  vma等于Target VMA
551  addr等于Faulting virtual address
553  mask等于swapin_nr_pages(offset)减1
554  如果非mask则转到:skip
558  如果此条件成立可能性大(为编译器优化)(SWP_USED etc: see above & (SWP_BLKDEV | SWP_FS))则
559  inode等于host
560  如果inode_read_congested(inode)则转到:skip
564  do_poll = false
566  start_offset等于offset按位与mask的反
567  end_offset等于offset按位或mask
568  如果非start_offsetstart_offset自加
570  如果end_offset大于等于xtent of the swap_map end_offset等于xtent of the swap_map 减1
573  blk_start_plug( & plug)
574 offset小于等于end_offset循环
576  page等于__read_swap_cache_async(Store a type+offset into a swp_entry_t in an arch-independent format, gfp_mask, vma, addr, & page_allocated)
579  如果非page则继续下一循环
581  如果page_allocated
582  swap_readpage(page, false)
583  如果offset不等于entry_offset
588  Perform a free_page(), also freeing any swap cache associated with* this page if it is the last user of the page.
590  blk_finish_plug( & plug)
592  lru_add_drain()
593  :
594  返回: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.