函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:Fastpath with forced inlining to produce a kfree and kmem_cache_free that* can perform fastpath freeing without additional function calls.* The fastpath is only possible if we are freeing to the current cpu slab* of this processor

函数原型:static __always_inline void do_slab_free(struct kmem_cache *s, struct page *page, void *head, void *tail, int cnt, unsigned long addr)

返回类型:void

参数:

类型参数名称
struct kmem_cache *s
struct page *page
void *head
void *tail
intcnt
unsigned longaddr
2961  tail_obj等于如果tail否则head
2964  redo :
2971  循环
2972  tid等于Operations with implied preemption/interrupt protection. These* operations can be used without worrying about preemption or interrupt.( Globally unique transaction id )
2973  c等于raw_cpu_ptr(cpu_slab)
2974 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 ))循环
2978  The "volatile" is due to gcc bugs ()
2980  如果此条件成立可能性大(为编译器优化)(page == The slab from which we are allocating )则
2981  set_freepointer(s, tail_obj, Pointer to next available object )
2988  note_cmpxchg_failure("slab_free", s, tid)
2989  转到:redo
2991  stat(s, Free to cpu slab )
2992  否则Slow path handling. This may still be called frequently since objects* have a longer lifetime than the cpu slabs in most processing loads.* So we still attempt to reduce cache line usage. Just take the slab* lock and free the item
调用者
名称描述
slab_free