Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:slab_alloc_node

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

Type:void

Parameter:

TypeParameterName
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  If Value for the false possibility is greater at compile time(!cachep) Then Return NULL
3279  cache_alloc_debugcheck_before(cachep, flags)
3280  local_irq_save(save_flags)
3282  If nodeid == NUMA_NO_NODE Then nodeid = slab_node
3285  If Value for the false possibility is greater at compile time(!get_node(cachep, nodeid)) Then
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  Go to out
3291  If nodeid == slab_node Then
3298  ptr = ____cache_alloc(cachep, flags)
3299  If ptr Then Go to 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  If Value for the false possibility is greater at compile time(slab_want_init_on_alloc(flags, cachep)) && ptr Then memset(ptr, 0, The size of an object without metadata )
3311  slab_post_alloc_hook(cachep, flags, 1, & ptr)
3312  Return ptr
Caller
NameDescribe
kmem_cache_alloc_nodekmem_cache_alloc_node - Allocate an object on the specified node*@cachep: The cache to allocate from.*@flags: See kmalloc().*@nodeid: node number of the target node.* Identical to kmem_cache_alloc but it will allocate memory on the given