Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:swap_page_trans_huge_swapped

Proto:static bool swap_page_trans_huge_swapped(struct swap_info_struct *si, swp_entry_t entry)

Type:bool

Parameter:

TypeParameterName
struct swap_info_struct *si
swp_entry_tentry
1542  map = vmalloc'ed array of usage counts
1543  roffset = Extract the `offset' field from a swp_entry_t. The swp_entry_t is in* arch-independent format
1544  offset = und_down - round down to next specified power of 2*@x: the value to round*@y: multiple to round down to (must be a power of 2)* Rounds @x down to next multiple of @y (which must be a power of 2).* To perform arbitrary rounding down, use rounddown() below.(roffset, SWAPFILE_CLUSTER)
1546  bool ret = false
1548  ci = Determine the locking method in use for this device. Return* swap_cluster_info if SSD-style cluster-based locking is in place.
1549  If Not ci || Not cluster_is_huge(ci) Then
1550  If swap_count(map[roffset]) Then ret = true
1552  Go to unlock_out
1554  When i < SWAPFILE_CLUSTER cycle
1555  If swap_count(map[offset + i]) Then
1556  ret = true
1557  Break
1560  unlock_out :
1561  unlock_cluster_or_swap_info(si, ci)
1562  Return ret
Caller
NameDescribe
page_swapped
free_swap_and_cacheFree the swap entry like above, but also try to* free the page cache entry if it is the last user.