Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\slub.c Create Date:2022-07-28 15:49:32
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:kmem_cache_shrink discards empty slabs and promotes the slabs filled* up most to the head of the partial lists. New allocations will then* fill those up and thus they can be removed from the partial lists.* The slabs with the least items are placed last

Proto:int __kmem_cache_shrink(struct kmem_cache *s)

Type:int

Parameter:

TypeParameterName
struct kmem_cache *s
3982  ret = 0
3984  flush_all(s)
3986  Initialization list head
3987  When i < SHRINK_PROMOTE_MAX cycle Initialization list head
3990  spin_lock_irqsave( & list_lock, flags)
3999  free = objects - SLUB
4002  The "volatile" is due to gcc bugs ()
4005  BUG_ON(free <= 0)
4007  If free == objects Then
4008  list_move - delete from one list and add as another's head*@list: the entry to move*@head: the head that will precede our entry
4009  nr_partial--
4010  Else if free <= SHRINK_PROMOTE_MAX Then list_move - delete from one list and add as another's head*@list: the entry to move*@head: the head that will precede our entry
4018  When i >= 0 cycle list_splice - join two lists, this is designed for stacks*@list: the new list to add.*@head: the place to add it in the first list.
4021  spin_unlock_irqrestore( & list_lock, flags)
4024  list_for_each_entry_safe - iterate over list of given type safe against removal of list entry*@pos: the type * to use as a loop cursor.*@n: another type * to use as temporary storage*@head: the head for your list.(page, t, & discard, slab_list)
4025  discard_slab(s, page)
4027  If slabs_node(s, node) Then ret = 1
4031  Return ret
Caller
NameDescribe
kmem_cache_shrink_allkmem_cache_shrink_all - shrink a cache and all memcg caches for root cache*@s: The cache pointer
__kmemcg_cache_deactivate
__kmem_cache_shutdown
__kmemcg_cache_deactivate_after_rcu
slab_mem_going_offline_callback