函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\swapfile.c Create Date:2022-07-27 16:48:30
Last Modify:2020-03-17 22:19:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称: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.

函数原型:int try_to_free_swap(struct page *page)

返回类型:int

参数:

类型参数名称
struct page *page
1695  VM_BUG_ON_PAGE(!PageLocked(page), page)
1697  如果非PageSwapCache(page)则返回:0
1699  如果Only test-and-set exist for PG_writeback. The unconditional operators are* risky: they bypass page accounting.则返回:0
1701  如果page_swapped(page)则返回:0
1719  如果pm_suspended_storage()则返回: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  返回:1
调用者
名称描述
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