函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称: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

函数原型:int __kmem_cache_shrink(struct kmem_cache *s)

返回类型:int

参数:

类型参数名称
struct kmem_cache *s
3982  ret等于0
3984  flush_all(s)
3986  初始化链表头
3987 i小于SHRINK_PROMOTE_MAX循环初始化链表头
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  如果free恒等于objects
4008  链表项移动到头部
4009  nr_partial自减
4010  否则如果free小于等于SHRINK_PROMOTE_MAX链表项移动到头部
4018 i大于等于0循环为栈加入第二个链表项
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  如果slabs_node(s, node)则ret等于1
4031  返回:ret
调用者
名称描述
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