函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:rns 1 if swap entry is freed

函数原型:static int __try_to_reclaim_swap(struct swap_info_struct *si, unsigned long offset, unsigned long flags)

返回类型:int

参数:

类型参数名称
struct swap_info_struct *si
unsigned longoffset
unsigned longflags
130  entry等于Store a type+offset into a swp_entry_t in an arch-independent format
132  ret等于0
134  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.
135  如果非page则返回:0
144  如果Return true if the page was successfully locked
145  如果flags按位与Reclaim the swap entry anyway if possible flags按位与Reclaim the swap entry if there are no more mappings of the* corresponding page且非Return true if this page is mapped into pagetables.* For compound page it returns true if any subpage of compound page is mapped.flags按位与Reclaim the swap entry if swap is getting fullmem_cgroup_swap_full(page)则ret等于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.
149  lock_page - unlock a locked page*@page: the page* Unlocks the page and wakes up sleepers in ___wait_on_page_locked().* Also wakes sleepers in wait_on_page_writeback() because the wakeup* mechanism between PageLocked pages and PageWriteback pages is shared.
151  Perform a free_page(), also freeing any swap cache associated with* this page if it is the last user of the page.
152  返回:ret
调用者
名称描述
scan_swap_map_slots
free_swap_and_cacheFree the swap entry like above, but also try to* free the page cache entry if it is the last user.