Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:If swap is getting full, or if there are no more mappings of this page,* then try_to_free_swap is called to free its swap space.

Proto:int try_to_free_swap(struct page *page)

Type:int

Parameter:

TypeParameterName
struct page *page
1695  VM_BUG_ON_PAGE(!PageLocked(page), page)
1697  If Not PageSwapCache(page) Then Return 0
1699  If Only test-and-set exist for PG_writeback. The unconditional operators are* risky: they bypass page accounting. Then Return 0
1701  If page_swapped(page) Then Return 0
1719  If pm_suspended_storage() Then Return 0
1722  page = compound_head(page)
1723  This must be called only on pages that have* been verified to be in the swap cache and locked.* It will never put the page into the free list,* the caller has a reference on the page.
1724  SetPageDirty(page)
1725  Return 1
Caller
NameDescribe
do_swap_pageWe enter with non-exclusive mmap_sem (to exclude vma changes,* but allow concurrent faults), and pte mapped but not yet locked.* We return with pte unmapped and unlocked.* We return with the mmap_sem locked or unlocked in the same cases
madvise_free_pte_range
swap_writepageWe may have stale swap cache pages in memory: notice* them here and get rid of the unnecessary final write.
free_swap_cacheIf we are the only user, then try to free up the swap cache. * Its ok to check for PageSwapCache without the page lock* here because we are going to recheck again inside* try_to_free_swap() _with_ the lock.* - Marcelo
__try_to_reclaim_swaprns 1 if swap entry is freed
unuse_pte_range
try_to_unuseIf the boolean frontswap is true, only unuse pages_to_unuse pages;* pages_to_unuse==0 means all pages; ignored if frontswap is false
replace_pageplace_page - replace page in vma by new ksm page*@vma: vma that holds the pte pointing to page*@page: the page we are replacing by kpage*@kpage: the ksm page we replace page by*@orig_pte: the original value of the pte