Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:We have to decide on how many pages to link together* to form a zspage for each size class. This is important* to reduce wastage due to unusable space left at end of* each zspage which is given as:* wastage = Zp % class_size* usage = Zp - wastage

Proto:static int get_pages_per_zspage(int class_size)

Type:int

Parameter:

TypeParameterName
intclass_size
803  max_usedpc = 0
805  max_usedpc_order = 1
807  When i <= ZS_MAX_PAGES_PER_ZSPAGE cycle
811  zspage_size = i * PAGE_SIZE
812  waste = zspage_size % class_size
813  usedpc = (zspage_size - waste) * 100 / zspage_size
815  If usedpc > max_usedpc Then
816  max_usedpc = usedpc
821  Return max_usedpc_order
Caller
NameDescribe
zs_create_poolzs_create_pool - Creates an allocation pool to work from.*@name: pool name to be created* This function must be called before anything when using* the zsmalloc allocator.* On success, a pointer to the newly created pool is returned,* otherwise NULL.