Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:Called after dropping swapcache to decrease refcnt to swap entries.

Proto:void put_swap_page(struct page *page, swp_entry_t entry)

Type:void

Parameter:

TypeParameterName
struct page *page
swp_entry_tentry
1327  offset = Extract the `offset' field from a swp_entry_t. The swp_entry_t is in* arch-independent format
1328  idx = offset / SWAPFILE_CLUSTER
1332  free_entries = 0
1334  size = Define swap_entry_size() as constant to let compiler to optimize* out some code if !CONFIG_THP_SWAP(hpage_nr_pages(page))
1336  si = _swap_info_get(entry)
1337  If Not si Then Return
1340  ci = Determine the locking method in use for this device. Return* swap_cluster_info if SSD-style cluster-based locking is in place.
1341  If size == SWAPFILE_CLUSTER Then
1342  VM_BUG_ON(!cluster_is_huge(ci))
1343  map = vmalloc'ed array of usage counts + offset
1344  When i < SWAPFILE_CLUSTER cycle
1345  val = map[i]
1350  cluster_clear_huge(ci)
1351  If free_entries == SWAPFILE_CLUSTER Then
1357  Return
1360  When i < size cycle
1364  If i == size - 1 Then Return
1369  unlock_cluster_or_swap_info(si, ci)
Caller
NameDescribe
add_to_swapadd_to_swap - allocate swap space for a page*@page: page we want to move to swap* Allocate swap space for the page and add the page to the* swap cache. Caller needs to hold the page lock.
delete_from_swap_cacheThis 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.
__read_swap_cache_async
get_swap_page