Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:__read_swap_cache_async

Proto:struct page *__read_swap_cache_async(swp_entry_t entry, gfp_t gfp_mask, struct vm_area_struct *vma, unsigned long addr, bool *new_page_allocated)

Type:struct page

Parameter:

TypeParameterName
swp_entry_tentry
gfp_tgfp_mask
struct vm_area_struct *vma
unsigned longaddr
bool *new_page_allocated
363  struct page * found_page = NULL, * new_page = NULL
366  * new_page_allocated = false
368  Do
374  si = Check whether swap entry is valid in the swap device
375  If Not si Then Break
377  found_page = d_get_page - find and get a page reference*@mapping: the address_space to search*@offset: the page index* Looks up the page cache slot at @mapping & @offset. If there is a* page cache page, it is returned with an increased refcount.
379  put_swap_device(si)
380  If found_page Then Break
391  If Not __swp_swapcount(entry) && swap_slot_cache_enabled Then Break
397  If Not new_page Then
399  If Not new_page Then Break
406  err = swapcache_prepare(entry)
407  If err == -EEXIST Then
413  cond_resched()
414  Continue
415  Else if err Then Break
419  __SetPageLocked(new_page)
420  __SetPageSwapBacked(new_page)
421  err = add_to_swap_cache resembles add_to_page_cache_locked on swapper_space,* but sets SwapCache flag and private instead of mapping and index.
426  * new_page_allocated = true
427  Return new_page
429  __ClearPageLocked(new_page)
434  put_swap_page(new_page, entry)
435  When err != -ENOMEM cycle
437  If new_page Then Perform a free_page(), also freeing any swap cache associated with* this page if it is the last user of the page.
439  Return found_page
Caller
NameDescribe
read_swap_cache_asyncLocate 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.
swap_cluster_readaheadswap_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.
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
zswap_get_swap_cache_pagezswap_get_swap_cache_page* This is an adaption of read_swap_cache_async()* This function tries to find a page with the given swap entry* in the swapper_space address space (the swap cache). If the page* is found, it is returned in retpage