Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\slab.c Create Date:2022-07-28 15:45:34
Last Modify:2022-05-23 17:02:55 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:slab_alloc

Proto:static __always_inline void *slab_alloc(struct kmem_cache *cachep, gfp_t flags, unsigned long caller)

Type:void

Parameter:

TypeParameterName
struct kmem_cache *cachep
gfp_tflags
unsigned longcaller
3353  flags &= gfp_allowed_mask
3354  cachep = slab_pre_alloc_hook(cachep, flags)
3355  If Value for the false possibility is greater at compile time(!cachep) Then Return 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  If Value for the false possibility is greater at compile time(slab_want_init_on_alloc(flags, cachep)) && objp Then memset(objp, 0, The size of an object without metadata )
3368  slab_post_alloc_hook(cachep, flags, 1, & objp)
3369  Return objp
Caller
NameDescribe
kmem_cache_allockmem_cache_alloc - Allocate an object*@cachep: The cache to allocate from
__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