Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:A interface to enable slab creation on nodeid

Proto:static void *____cache_alloc_node(struct kmem_cache *cachep, gfp_t flags, int nodeid)

Type:void

Parameter:

TypeParameterName
struct kmem_cache *cachep
gfp_tflags
intnodeid
3224  void * obj = NULL
3225  void * list = NULL
3227  VM_BUG_ON(nodeid < 0 || nodeid >= MAX_NUMNODES)
3228  n = get_node(cachep, nodeid)
3229  BUG_ON(!n)
3231  check_irq_off()
3232  spin_lock( & list_lock)
3233  page = get_first_slab(n, false)
3234  If Not page Then Go to must_grow
3237  check_spinlock_acquired_node(cachep, nodeid)
3239  STATS_INC_NODEALLOCS(cachep)
3240  STATS_INC_ACTIVE(cachep)
3241  STATS_SET_HIGH(cachep)
3243  BUG_ON( SLAB == num)
3245  obj = slab_get_obj(cachep, page)
3246  free_objects--
3248  fixup_slab_list(cachep, n, page, & list)
3250  spin_unlock( & list_lock)
3251  fixup_objfreelist_debug(cachep, & list)
3252  Return obj
3254  must_grow :
3255  spin_unlock( & list_lock)
3256  page = Grow (by 1) the number of slabs within a cache. This is called by* kmem_cache_alloc() when there are no active objs left in a cache.
3257  If page Then
3259  obj = slab_get_obj(cachep, page)
3261  cache_grow_end(cachep, page)
3263  Return If obj Then obj Else 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
Caller
NameDescribe
alternate_node_allocTry allocating on another node if PFA_SPREAD_SLAB is a mempolicy is set.* If we are in_interrupt, then process context, including cpusets and* mempolicy, may not apply and should not be used for allocation policy.
fallback_allocFallback 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
slab_alloc_node
__do_cache_alloc