Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:Lookup a swap entry in the swap cache. A found page will be returned* unlocked and with its refcount incremented - we rely on the kernel* lock getting page table operations atomic even if we drop the page* lock before returning.

Proto:struct page *lookup_swap_cache(swp_entry_t entry, struct vm_area_struct *vma, unsigned long addr)

Type:struct page

Parameter:

TypeParameterName
swp_entry_tentry
struct vm_area_struct *vma
unsigned longaddr
316  si = Check whether swap entry is valid in the swap device
317  If Not si Then Return NULL
319  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.
320  put_swap_device(si)
322  INC_CACHE_INFO(find_total)
323  If page Then
324  vma_ra = swap_use_vma_readahead()
327  INC_CACHE_INFO(find_success)
332  If Value for the false possibility is greater at compile time(PageTransCompound returns true for both transparent huge pages* and hugetlbfs pages, so it should only be called when it's known* that hugetlbfs pages aren't involved.) Then Return page
335  readahead = TestClearPageReadahead(page)
336  If vma && vma_ra Then
349  If readahead Then
351  If Not vma || Not vma_ra Then atomic_inc( & swapin_readahead_hits)
356  Return page