Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:mempool_init_node

Proto:int mempool_init_node(mempool_t *pool, int min_nr, mempool_alloc_t *alloc_fn, mempool_free_t *free_fn, void *pool_data, gfp_t gfp_mask, int node_id)

Type:int

Parameter:

TypeParameterName
mempool_t *pool
intmin_nr
mempool_alloc_t *alloc_fn
mempool_free_t *free_fn
void *pool_data
gfp_tgfp_mask
intnode_id
184  Process spin lock initialization( & lock)
185  nr of elements at *elements = min_nr
186  pool_data = pool_data
187  alloc = alloc_fn
188  free = free_fn
189  init_waitqueue_head( & wait)
191  elements = kmalloc_array_node(min_nr, size of * , gfp_mask, node_id)
193  If Not elements Then Return -ENOMEM
199  When Current nr of elements at *elements < nr of elements at *elements cycle
202  element = alloc(gfp_mask, pool_data)
205  Return -ENOMEM
207  add_element(pool, element)
210  Return 0
Caller
NameDescribe
mempool_initmempool_init - initialize a memory pool*@pool: pointer to the memory pool that should be initialized*@min_nr: the minimum number of elements guaranteed to be* allocated for this pool.*@alloc_fn: user-defined element-allocation function.
mempool_create_node