Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:rns 1 if swap entry is freed

Proto:static int __try_to_reclaim_swap(struct swap_info_struct *si, unsigned long offset, unsigned long flags)

Type:int

Parameter:

TypeParameterName
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  If Not page Then Return 0
144  If Return true if the page was successfully locked Then
145  If flags & Reclaim the swap entry anyway if possible || flags & Reclaim the swap entry if there are no more mappings of the* corresponding page && Not 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 full && mem_cgroup_swap_full(page) Then 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  Return ret
Caller
NameDescribe
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.