函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:A interface to enable slab creation on nodeid

函数原型:static void *____cache_alloc_node(struct kmem_cache *cachep, gfp_t flags, int nodeid)

返回类型:void

参数:

类型参数名称
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  加自旋锁
3233  page等于get_first_slab(n, false)
3234  如果非page则转到: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  自旋锁解锁
3251  fixup_objfreelist_debug(cachep, & list)
3252  返回:obj
3254  must_grow :
3255  自旋锁解锁
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  如果page
3259  obj等于slab_get_obj(cachep, page)
3261  cache_grow_end(cachep, page)
3263  返回:如果objobj否则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
调用者
名称描述
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