Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:Allocate a zspage for the given size class

Proto:static struct zspage *alloc_zspage(struct zs_pool *pool, struct size_class *class, gfp_t gfp)

Type:struct zspage

Parameter:

TypeParameterName
struct zs_pool *pool
struct size_class *class
gfp_tgfp
1069  zspage = cache_alloc_zspage(pool, gfp)
1071  If Not zspage Then Return NULL
1074  memset(zspage, 0, size of zspage )
1075  magic = ZSPAGE_MAGIC
1076  migrate_lock_init(zspage)
1078  When i < Number of PAGE_SIZE sized pages to combine to form a 'zspage' cycle
1081  page = alloc_page(gfp)
1082  If Not page Then
1083  When --i >= 0 cycle
1088  Return NULL
1091  We only use atomic operations to update counters. So there is no need to* disable interrupts.(page, allocated in zsmalloc )
1092  pages[i] = page
1095  create_page_chain(class, zspage, pages)
1096  Initialize a newly allocated zspage
1098  Return zspage
Caller
NameDescribe
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.