Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\zsmalloc.c Create Date:2022-07-28 16:26:51
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:Each size class maintains various freelists and zspages are assigned* to one of these freelists based on the number of live objects they* have. This functions inserts the given zspage into the freelist* identified by <class, fullness_group>.

Proto:static void insert_zspage(struct size_class *class, struct zspage *zspage, enum fullness_group fullness)

Type:void

Parameter:

TypeParameterName
struct size_class *class
struct zspage *zspage
enum fullness_groupfullness
726  ype can be of enum type zs_stat_type or fullness_group
727  head = list_first_entry_or_null - get the first element from a list*@ptr: the list head to take the element from.*@type: the type of the struct this is embedded in.*@member: the name of the list_head within the struct.( & fullness_list[fullness], structzspage, list)
733  If head Then
736  Return
739  list_add - add a new entry*@new: new entry to be added*@head: list head to add it after* Insert a new entry after the specified head.* This is good for implementing stacks.
Caller
NameDescribe
fix_fullness_groupEach size class maintains zspages in different fullness groups depending* on the number of live objects they contain. When allocating or freeing* objects, the fullness status of the page can change, say, from ALMOST_FULL
zs_malloczs_malloc - Allocate block of given size from pool.*@pool: pool to allocate from*@size: size of block to allocate*@gfp: gfp flags when allocating object* On success, handle to the allocated object is returned,* otherwise 0.
putback_zspageputback_zspage - add @zspage into right class's fullness list*@class: destination class*@zspage: target page* Return @zspage's fullness_group