Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:cache_alloc_refill

Proto:static void *cache_alloc_refill(struct kmem_cache *cachep, gfp_t flags)

Type:void

Parameter:

TypeParameterName
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  If Not touched && batchcount > BATCHREFILL_LIMIT Then
2974  batchcount = BATCHREFILL_LIMIT
2976  n = get_node(cachep, node)
2978  BUG_ON(avail > 0 || !n)
2979  shared = READ_ONCE(shared)
2980  If Not free_objects && ( Not shared || Not avail ) Then Go to direct_grow
2983  spin_lock( & list_lock)
2984  shared = READ_ONCE(shared)
2987  If shared && Transfer objects in one arraycache to another.* Locking must be handled by the caller.* Return the number of entries transferred. Then
2988  touched = 1
2989  Go to alloc_done
2992  When batchcount > 0 cycle
2994  page = get_first_slab(n, false)
2995  If Not page Then Go to 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  spin_unlock( & list_lock)
3008  fixup_objfreelist_debug(cachep, & list)
3010  direct_grow :
3011  If Value for the false possibility is greater at compile time(!avail) Then
3013  If sk_memalloc_socks() Then
3016  If obj Then Return 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  If Not avail && page Then Slab 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  If Not avail Then Return NULL
3034  touched = 1
3036  Return Must have this definition in here for the proper* alignment of array_cache. Also simplifies accessing* the entries.[--avail]
Caller
NameDescribe
____cache_alloc