函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:Called after dropping swapcache to decrease refcnt to swap entries.

函数原型:void put_swap_page(struct page *page, swp_entry_t entry)

返回类型:void

参数:

类型参数名称
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等于offsetSWAPFILE_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  如果非si则返回
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  如果size恒等于SWAPFILE_CLUSTER
1342  VM_BUG_ON(!cluster_is_huge(ci))
1343  map等于vmalloc'ed array of usage counts offset
1344 i小于SWAPFILE_CLUSTER循环
1345  val等于map[i]
1350  cluster_clear_huge(ci)
1351  如果free_entries恒等于SWAPFILE_CLUSTER
1353  加自旋锁
1357  返回
1360 i小于size循环
1364  如果i恒等于size减1则返回
1369  unlock_cluster_or_swap_info(si, ci)
调用者
名称描述
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