Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:drain_freelist

Proto:static int drain_freelist(struct kmem_cache *cache, struct kmem_cache_node *n, int tofree)

Type:int

Parameter:

TypeParameterName
struct kmem_cache *cache
struct kmem_cache_node *n
inttofree
2237  nr_freed = 0
2238  When nr_freed < tofree && Not list_empty - tests whether a list is empty*@head: the list to test. cycle
2240  spin_lock_irq( & list_lock)
2241  p = prev
2242  If p == slabs_free Then
2244  Go to out
2247  page = list_entry - get the struct for this entry*@ptr: the &struct list_head pointer.*@type: the type of the struct this is embedded in.*@member: the name of the list_head within the struct.(p, structpage, slab_list)
2248  deletes entry from list
2249  free_slabs--
2250  total_slabs--
2255  free_objects -= num
2256  spin_unlock_irq( & list_lock)
2257  slab_destroy - destroy and release all objects in a slab*@cachep: cache pointer being destroyed*@page: page pointer being destroyed* Destroy all the objs in a slab page, and release the mem back to the system.
2258  nr_freed++
2260  out :
2261  Return nr_freed
Caller
NameDescribe
drain_cache_node_nodeDrains freelist for a node on each slab cache, used for memory hot-remove.* Returns -EBUSY if all objects cannot be drained so that the node is not* removed.* Must hold slab_mutex.
__kmem_cache_shrink
cache_reapache_reap - Reclaim memory from caches