函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:mempool_alloc - allocate an element from a specific memory pool*@pool: pointer to the memory pool which was allocated via* mempool_create().*@gfp_mask: the usual allocation bitmask.* this function only sleeps if the alloc_fn() function sleeps or

函数原型:void *mempool_alloc(mempool_t *pool, gfp_t gfp_mask)

返回类型:void

参数:

类型参数名称
mempool_t *pool
gfp_tgfp_mask
382  VM_WARN_ON_ONCE(gfp_mask & __GFP_ZERO)
383  might_sleep_if(gfp_mask & Caller can reclaim )
385  gfp_mask或等于__GFP_NOMEMALLOC
386  gfp_mask或等于__GFP_NORETRY
387  gfp_mask或等于DOC: Action modifiers* Action modifiers* ~~~~~~~~~~~~~~~~* %__GFP_NOWARN suppresses allocation failure reports.* %__GFP_COMP address compound page metadata.* %__GFP_ZERO returns a zeroed page on success.
389  gfp_temp等于gfp_mask按位与Caller can reclaim 按位或DOC: Reclaim modifiers* Reclaim modifiers* ~~~~~~~~~~~~~~~~~* %__GFP_IO can start physical IO.* %__GFP_FS can call down to the low-level FS. Clearing the flag avoids the* allocator recursing into the filesystem which might already be holding* locks.的值的反
391  repeat_alloc :
393  element等于alloc(gfp_temp, pool_data)
394  如果此条件成立可能性大(为编译器优化)(element != NULL)则返回:element
397  spin_lock_irqsave( & lock, flags)
398  如果此条件成立可能性大(为编译器优化)( Current nr of elements at *elements )则
399  element等于remove_element(pool)
400  spin_unlock_irqrestore( & lock, flags)
402  smp_wmb()
407  kmemleak_update_trace(element)
408  返回:element
415  如果gfp_temp不等于gfp_mask
416  spin_unlock_irqrestore( & lock, flags)
417  gfp_temp等于gfp_mask
418  转到:repeat_alloc
422  如果非gfp_mask按位与Caller can reclaim 的值则
423  spin_unlock_irqrestore( & lock, flags)
424  返回:NULL
428  init_wait( & wait)
429  Note: we use "set_current_state()" _after_ the wait-queue add,* because we need a memory barrier there on SMP, so that any* wake-function that tests for the wait-queue being active* will be guaranteed to see waitqueue addition _or_ subsequent
431  spin_unlock_irqrestore( & lock, flags)
437  This task is about to go to sleep on IO. Increment rq->nr_iowait so* that process accounting knows that this is a task in IO wait state.
439  sh_wait - clean up after waiting in a queue*@wq_head: waitqueue waited on*@wq_entry: wait descriptor* Sets current thread back to running state and removes* the wait descriptor from the given waitqueue if still* queued.
440  转到:repeat_alloc
调用者
名称描述
sg_pool_alloc
bio_alloc_bioset_alloc_bioset - allocate a bio for I/O*@gfp_mask: the GFP_* mask given to the slab allocator*@nr_iovecs: number of iovecs to pre-allocate*@bs: the bio_set to allocate from
__blk_queue_bounce
bio_integrity_alloc_integrity_alloc - Allocate integrity payload and attach it to bio*@bio: bio to attach integrity metadata to*@gfp_mask: Memory allocation mask*@nr_vecs: Number of integrity metadata scatter-gather elements* Description: This function prepares a bio for
btree_node_alloc
bvec_alloc
fscrypt_alloc_bounce_page