函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\slub.c Create Date:2022-07-27 17:22:22
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:Inlined fastpath so that allocation functions (kmalloc, kmem_cache_alloc)* have the fastpath folded into their functions. So no function call* overhead for requests that can be satisfied on the fastpath.

函数原型:static __always_inline void *slab_alloc_node(struct kmem_cache *s, gfp_t gfpflags, int node, unsigned long addr)

返回类型:void

参数:

类型参数名称
struct kmem_cache *s
gfp_tgfpflags
intnode
unsigned longaddr
2683  s等于slab_pre_alloc_hook(s, gfpflags)
2684  如果非s则返回:NULL
2686  redo :
2697  循环
2698  tid等于Operations with implied preemption/interrupt protection. These* operations can be used without worrying about preemption or interrupt.( Globally unique transaction id )
2699  c等于raw_cpu_ptr(cpu_slab)
2700 IS_ENABLED(CONFIG_FOO) evaluates to 1 if CONFIG_FOO is set to 'y' or 'm',* 0 otherwise.(CONFIG_PREEMPT)且此条件成立可能性小(为编译器优化)(tid != READ_ONCE( Globally unique transaction id ))循环
2711  The "volatile" is due to gcc bugs ()
2720  object等于 Pointer to next available object
2721  page等于 The slab from which we are allocating
2722  如果此条件成立可能性小(为编译器优化)(!object || !Check if the objects in a per cpu structure fit numa* locality expectations.)则
2723  object等于Another one that disabled interrupt and compensates for possible* cpu changes by refetching the per cpu area pointer.
2724  stat(s, Allocation by getting a new cpu slab )
2725  否则
2726  next_object等于get_freepointer_safe(s, object)
2747  note_cmpxchg_failure("slab_alloc", s, tid)
2748  转到:redo
2750  prefetch_freepointer(s, next_object)
2751  stat(s, Allocation from cpu slab )
2754  If the object has been wiped upon free, make sure it's fully initialized by* zeroing out freelist pointer.
2756  如果此条件成立可能性小(为编译器优化)(slab_want_init_on_alloc(gfpflags, s))且objectmemset(object, 0, The size of an object without metadata )
2759  slab_post_alloc_hook(s, gfpflags, 1, & object)
2761  返回:object
调用者
名称描述
slab_alloc
kmem_cache_alloc_node在指定节点上分配一个对象
__kmalloc_node
__kmalloc_node_track_caller
kmem_cache_alloc_node在指定节点上分配一个对象