Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\swap_state.c Create Date:2022-07-28 15:14:56
Last Modify:2020-03-17 22:02:06 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name: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.

Proto:struct page *swap_cluster_readahead(swp_entry_t entry, gfp_t gfp_mask, struct vm_fault *vmf)

Type:struct page

Parameter:

TypeParameterName
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  If Not mask Then Go to skip
558  If Value is more likely to compile time(SWP_USED etc: see above & (SWP_BLKDEV | SWP_FS)) Then
559  inode = host
560  If inode_read_congested(inode) Then Go to skip
564  do_poll = false
566  start_offset = offset & ~mask
567  end_offset = offset | mask
568  If Not start_offset Then start_offset++
570  If end_offset >= xtent of the swap_map Then end_offset = xtent of the swap_map - 1
573  blk_start_plug( & plug)
574  When offset <= end_offset cycle
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  If Not page Then Continue
581  If page_allocated Then
582  swap_readpage(page, false)
583  If offset != entry_offset Then
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  Return 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.
Caller
NameDescribe
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.