Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:How many references to @entry are currently swapped out?* This considers COUNT_CONTINUED so it returns exact answer.

Proto:int swp_swapcount(swp_entry_t entry)

Type:int

Parameter:

TypeParameterName
swp_entry_tentry
1505  p = _swap_info_get(entry)
1506  If Not p Then Return 0
1509  offset = Extract the `offset' field from a swp_entry_t. The swp_entry_t is in* arch-independent format
1511  ci = Determine the locking method in use for this device. Return* swap_cluster_info if SSD-style cluster-based locking is in place.
1513  count = swap_count(vmalloc'ed array of usage counts [offset])
1514  If Not (count & See swap_map continuation for full count ) Then Go to out
1517  count &= ~See swap_map continuation for full count
1518  n = Max duplication count, in first swap_map + 1
1520  page = Walk a vmap address to the struct page it maps.
1521  offset &= ~PAGE_MASK
1522  VM_BUG_ON(page_private(page) != SWP_CONTINUED)
1524  Do
1525  page = list_next_entry - get the next element in list*@pos: the type * to cursor*@member: the name of the list_head within the struct.(page, lru)
1526  map = kmap_atomic(page)
1527  tmp_count = map[offset]
1528  Prevent people trying to call kunmap_atomic() as if it were kunmap()* kunmap_atomic() should get the return value of kmap_atomic, not the page.(map)
1530  count += (tmp_count & ~See swap_map continuation for full count ) * n
1531  n *= Max count, in each swap_map continuation + 1
1532  When tmp_count & See swap_map continuation for full count cycle
1533  out :
1534  unlock_cluster_or_swap_info(p, ci)
1535  Return count