Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:Try to allocate a partial slab from a specific node.

Proto:static void *get_partial_node(struct kmem_cache *s, struct kmem_cache_node *n, struct kmem_cache_cpu *c, gfp_t flags)

Type:void

Parameter:

TypeParameterName
struct kmem_cache *s
struct kmem_cache_node *n
struct kmem_cache_cpu *c
gfp_tflags
1840  void * object = NULL
1841  available = 0
1850  If Not n || Not nr_partial Then Return NULL
1853  spin_lock( & list_lock)
1857  If Not pfmemalloc_match(page, flags) Then Continue
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  If Not t Then Break
1864  available += objects
1865  If Not object Then
1866  The slab from which we are allocating = page
1867  stat(s, Cpu slab acquired from node partial list )
1868  object = t
1869  Else
1870  put_cpu_partial(s, page, 0)
1871  stat(s, Refill cpu partial from node partial )
1873  If Not kmem_cache_has_cpu_partial(s) || available > slub_cpu_partial(s) / 2 Then Break
1878  spin_unlock( & list_lock)
1879  Return object
Caller
NameDescribe
get_any_partialGet a page from somewhere. Search in increasing NUMA distances.
get_partialGet a partial page, lock it and return it.