Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:swap_discard_work

Proto:static void swap_discard_work(struct work_struct *work)

Type:void

Parameter:

TypeParameterName
struct work_struct *work
496  si = container_of - cast a member of a structure out to the containing structure*@ptr: the pointer to the member.*@type: the type of the container struct this is embedded in.*@member: the name of the member within the struct.(work, structswap_info_struct, discard_work)
498  spin_lock( & protect map scan related fields like* swap_map, lowest_bit, highest_bit,* inuse_pages, cluster_next,* cluster_nr, lowest_alloc,* highest_alloc, free/discard cluster* list. other fields are only changed* at swapon/swapoff, so are protected* by swap_lock)
499  Doing discard actually. After a cluster discard is finished, the cluster* will be added to free cluster list. caller should hold si->lock.
500  spin_unlock( & protect map scan related fields like* swap_map, lowest_bit, highest_bit,* inuse_pages, cluster_next,* cluster_nr, lowest_alloc,* highest_alloc, free/discard cluster* list. other fields are only changed* at swapon/swapoff, so are protected* by swap_lock)