Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

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

Proto:static struct page *swap_vma_readahead(swp_entry_t fentry, gfp_t gfp_mask, struct vm_fault *vmf)

Type:struct page

Parameter:

TypeParameterName
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  If win == 1 Then Go to skip
738  blk_start_plug( & plug)
739  When i < nr_pte cycle
741  pentry = pte
742  If pte_none(pentry) Then Continue
744  If pte_present(pentry) Then Continue
746  entry = Convert the arch-dependent pte representation of a swp_entry_t into an* arch-independent swp_entry_t.
747  If Value for the false possibility is greater at compile time(non_swap_entry(entry)) Then Continue
749  page = __read_swap_cache_async(entry, gfp_mask, vma, Faulting virtual address , & page_allocated)
751  If Not page Then Continue
753  If page_allocated Then
754  swap_readpage(page, false)
755  If i != offset Then
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  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.