函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\zsmalloc.c Create Date:2022-07-27 18:02:12
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:Allocate a zspage for the given size class

函数原型:static struct zspage *alloc_zspage(struct zs_pool *pool, struct size_class *class, gfp_t gfp)

返回类型:struct zspage

参数:

类型参数名称
struct zs_pool *pool
struct size_class *class
gfp_tgfp
1069  zspage等于cache_alloc_zspage(pool, gfp)
1071  如果非zspage则返回:NULL
1074  memset(zspage, 0, zspage的长度)
1075  magic等于ZSPAGE_MAGIC
1076  migrate_lock_init(zspage)
1078 i小于 Number of PAGE_SIZE sized pages to combine to form a 'zspage' 循环
1081  page等于alloc_page(gfp)
1082  如果非page
1083 i先自减大于等于0循环
1088  返回: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  返回:zspage
调用者
名称描述
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.