Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:allocate_slab

Proto:static struct page *allocate_slab(struct kmem_cache *s, gfp_t flags, int node)

Type:struct page

Parameter:

TypeParameterName
struct kmem_cache *s
gfp_tflags
intnode
1620  oo = oo
1626  flags &= gfp_allowed_mask
1628  If gfpflags_allow_blocking(flags) Then The local_irq_*() APIs are equal to the raw_local_irq*()* if !TRACE_IRQFLAGS.()
1631  flags |= gfp flags to use on each alloc
1637  alloc_gfp = ( flags | DOC: Action modifiers* Action modifiers* ~~~~~~~~~~~~~~~~* %__GFP_NOWARN suppresses allocation failure reports.* %__GFP_COMP address compound page metadata.* %__GFP_ZERO returns a zeroed page on success. | __GFP_NORETRY) & ~__GFP_NOFAIL
1638  If alloc_gfp & Caller can reclaim && oo_order(oo) > oo_order(min) Then alloc_gfp = (alloc_gfp | __GFP_NOMEMALLOC) & ~(__GFP_RECLAIM | __GFP_NOFAIL)
1641  page = Slab allocation and freeing
1642  If Value for the false possibility is greater at compile time(!page) Then
1643  oo = min
1644  alloc_gfp = flags
1649  page = Slab allocation and freeing
1650  If Value for the false possibility is greater at compile time(!page) Then Go to out
1652  stat(s, Number of times fallback was necessary )
1655  objects = oo_objects(oo)
1657  not slob = s
1658  __SetPageSlab(page)
1659  If Return true only if the page has been allocated with* ALLOC_NO_WATERMARKS and the low watermark was not* met implying that the system is under some pressure. Then SetPageSlabPfmemalloc(page)
1662  kasan_poison_slab(page)
1664  start = page_address(page)
1666  setup_page_debug(s, page, start)
1668  shuffle = shuffle_freelist(s, page)
1670  If Not shuffle Then
1671  start = fixup_red_left(s, start)
1672  start = setup_object(s, page, start)
1673  first free object = start
1674  When idx < objects - 1 cycle
1676  next = setup_object(s, page, next)
1677  set_freepointer(s, p, next)
1678  p = next
1680  set_freepointer(s, p, NULL)
1683  SLUB = objects
1684  frozen = 1
1686  out :
1687  If gfpflags_allow_blocking(flags) Then local_irq_disable()
1689  If Not page Then Return NULL
1692  inc_slabs_node(s, page_to_nid(page), objects)
1694  Return page
Caller
NameDescribe
new_slab