函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:cache_alloc_refill

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

返回类型:void

参数:

类型参数名称
struct kmem_cache *cachep
gfp_tflags
2960  void * list = NULL
2963  check_irq_off()
2964  node等于Returns the number of the nearest Node with memory
2966  ac等于cpu_cache_get(cachep)
2967  batchcount等于batchcount
2968  如果非touchedbatchcount大于BATCHREFILL_LIMIT
2974  batchcount等于BATCHREFILL_LIMIT
2976  n等于get_node(cachep, node)
2978  BUG_ON(avail > 0 || !n)
2979  shared等于READ_ONCE(shared)
2980  如果非free_objects且非shared或非avail的值则转到:direct_grow
2983  加自旋锁
2984  shared等于READ_ONCE(shared)
2987  如果sharedTransfer objects in one arraycache to another.* Locking must be handled by the caller.* Return the number of entries transferred.
2988  touched等于1
2989  转到:alloc_done
2992 batchcount大于0循环
2994  page等于get_first_slab(n, false)
2995  如果非page则转到:must_grow
2998  check_spinlock_acquired(cachep)
3000  batchcount等于Slab list should be fixed up by fixup_slab_list() for existing slab* or cache_grow_end() for new slab
3001  fixup_slab_list(cachep, n, page, & list)
3004  must_grow :
3005  free_objects减等于avail
3006  alloc_done :
3007  自旋锁解锁
3008  fixup_objfreelist_debug(cachep, & list)
3010  direct_grow :
3011  如果此条件成立可能性小(为编译器优化)(!avail)则
3013  如果sk_memalloc_socks()则
3016  如果obj则返回:obj
3020  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.
3026  ac等于cpu_cache_get(cachep)
3027  如果非availpageSlab list should be fixed up by fixup_slab_list() for existing slab* or cache_grow_end() for new slab
3029  cache_grow_end(cachep, page)
3031  如果非avail则返回:NULL
3034  touched等于1
3036  返回:Must have this definition in here for the proper* alignment of array_cache. Also simplifies accessing* the entries.[--avail]
调用者
名称描述
____cache_alloc