函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\slab.c Create Date:2022-07-27 17:19:23
Last Modify:2022-05-23 17:02:55 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:slab_alloc_node

函数原型:static __always_inline void *slab_alloc_node(struct kmem_cache *cachep, gfp_t flags, int nodeid, unsigned long caller)

返回类型:void

参数:

类型参数名称
struct kmem_cache *cachep
gfp_tflags
intnodeid
unsigned longcaller
3272  slab_node等于Returns the number of the nearest Node with memory
3274  flags与等于gfp_allowed_mask
3275  cachep等于slab_pre_alloc_hook(cachep, flags)
3276  如果此条件成立可能性小(为编译器优化)(!cachep)则返回:NULL
3279  cache_alloc_debugcheck_before(cachep, flags)
3280  local_irq_save(save_flags)
3282  如果nodeid恒等于NUMA_NO_NODEnodeid等于slab_node
3285  如果此条件成立可能性小(为编译器优化)(!get_node(cachep, nodeid))则
3287  ptr等于Fallback function if there was no memory available and no objects on a* certain node and fall back is permitted. First we scan all the* available node for available objects. If that fails then we* perform an allocation without specifying a node
3288  转到:out
3291  如果nodeid恒等于slab_node
3298  ptr等于____cache_alloc(cachep, flags)
3299  如果ptr则转到:out
3303  ptr等于A interface to enable slab creation on nodeid
3304  out :
3305  local_irq_restore(save_flags)
3306  ptr等于cache_alloc_debugcheck_after(cachep, flags, ptr, caller)
3308  如果此条件成立可能性小(为编译器优化)(slab_want_init_on_alloc(flags, cachep))且ptrmemset(ptr, 0, The size of an object without metadata )
3311  slab_post_alloc_hook(cachep, flags, 1, & ptr)
3312  返回:ptr
调用者
名称描述
kmem_cache_alloc_node在指定节点上分配一个对象