Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:The cluster corresponding to page_nr decreases one usage. If the usage* counter becomes 0, which means no page in the cluster is in using, we can* optionally discard the cluster and add it to free cluster list.

Proto:static void dec_cluster_info_page(struct swap_info_struct *p, struct swap_cluster_info *cluster_info, unsigned long page_nr)

Type:void

Parameter:

TypeParameterName
struct swap_info_struct *p
struct swap_cluster_info *cluster_info
unsigned longpage_nr
558  idx = page_nr / SWAPFILE_CLUSTER
560  If Not cluster_info Then Return
563  VM_BUG_ON(cluster_count( & cluster_info[idx]) == 0)
564  cluster_set_count( & cluster_info[idx], cluster_count( & cluster_info[idx]) - 1)
567  If cluster_count( & cluster_info[idx]) == 0 Then free_cluster(p, idx)
Caller
NameDescribe
swap_entry_free