函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:slab_alloc

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

返回类型:void

参数:

类型参数名称
struct kmem_cache *cachep
gfp_tflags
unsigned longcaller
3353  flags与等于gfp_allowed_mask
3354  cachep等于slab_pre_alloc_hook(cachep, flags)
3355  如果此条件成立可能性小(为编译器优化)(!cachep)则返回:NULL
3358  cache_alloc_debugcheck_before(cachep, flags)
3359  local_irq_save(save_flags)
3360  objp等于__do_cache_alloc(cachep, flags)
3361  local_irq_restore(save_flags)
3362  objp等于cache_alloc_debugcheck_after(cachep, flags, objp, caller)
3363  3dnow prefetch to get an exclusive cache line.* Useful for spinlocks to avoid one state transition in the* cache coherency protocol:
3365  如果此条件成立可能性小(为编译器优化)(slab_want_init_on_alloc(flags, cachep))且objpmemset(objp, 0, The size of an object without metadata )
3368  slab_post_alloc_hook(cachep, flags, 1, & objp)
3369  返回:objp
调用者
名称描述
kmem_cache_alloc分配高速缓存区
__do_kmalloc__do_kmalloc - allocate memory*@size: how many bytes of memory are required.*@flags: the type of memory to allocate (see kmalloc).*@caller: function caller for debug tracking of the caller* Return: pointer to the allocated memory or %NULL in case of error