Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:swap_alloc_cluster

Proto:static int swap_alloc_cluster(struct swap_info_struct *si, swp_entry_t *slot)

Type:int

Parameter:

TypeParameterName
struct swap_info_struct *si
swp_entry_t *slot
940  If Not IS_ENABLED(CONFIG_FOO) evaluates to 1 if CONFIG_FOO is set to 'y' or 'm',* 0 otherwise.(CONFIG_THP_SWAP) Then
941  VM_WARN_ON_ONCE(1)
942  Return 0
945  If cluster_list_empty( & clusters list ) Then Return 0
948  idx = cluster_list_first( & clusters list )
949  offset = idx * SWAPFILE_CLUSTER
950  ci = lock_cluster(si, offset)
951  alloc_cluster(si, idx)
952  cluster_set_count_flag(ci, SWAPFILE_CLUSTER, This cluster is backing a transparent huge page )
954  map = vmalloc'ed array of usage counts + offset
955  When i < SWAPFILE_CLUSTER cycle map[i] = Flag page is cached, in first swap_map
957  unlock_cluster(ci)
958  swap_range_alloc(si, offset, SWAPFILE_CLUSTER)
959  slot = Store a type+offset into a swp_entry_t in an arch-independent format
961  Return 1
Caller
NameDescribe
get_swap_pages