函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:Try to allocate a partial slab from a specific node.

函数原型:static void *get_partial_node(struct kmem_cache *s, struct kmem_cache_node *n, struct kmem_cache_cpu *c, gfp_t flags)

返回类型:void

参数:

类型参数名称
struct kmem_cache *s
struct kmem_cache_node *n
struct kmem_cache_cpu *c
gfp_tflags
1840  void * object = NULL
1841  available等于0
1850  如果非n或非nr_partial则返回:NULL
1853  加自旋锁
1857  如果非pfmemalloc_match(page, flags)则继续下一循环
1860  t等于Remove slab from the partial list, freeze it and* return the pointer to the freelist.* Returns a list of objects or NULL if it fails.
1861  如果非t退出
1864  available加等于objects
1865  如果非object
1866  The slab from which we are allocating 等于page
1867  stat(s, Cpu slab acquired from node partial list )
1868  object等于t
1869  否则
1870  put_cpu_partial(s, page, 0)
1871  stat(s, Refill cpu partial from node partial )
1873  如果非kmem_cache_has_cpu_partial(s)或available大于slub_cpu_partial(s)除2则退出
1878  自旋锁解锁
1879  返回:object
调用者
名称描述
get_any_partialGet a page from somewhere. Search in increasing NUMA distances.
get_partialGet a partial page, lock it and return it.