函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:allocate_slab

函数原型:static struct page *allocate_slab(struct kmem_cache *s, gfp_t flags, int node)

返回类型:struct page

参数:

类型参数名称
struct kmem_cache *s
gfp_tflags
intnode
1620  oo等于oo
1626  flags与等于gfp_allowed_mask
1628  如果gfpflags_allow_blocking(flags)则开中断()
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  如果alloc_gfp按位与Caller can reclaim oo_order(oo)大于oo_order(min)则alloc_gfp等于alloc_gfp按位或__GFP_NOMEMALLOC的值按位与__GFP_RECLAIM按位或__GFP_NOFAIL的值的反
1641  page等于Slab allocation and freeing
1642  如果此条件成立可能性小(为编译器优化)(!page)则
1643  oo等于min
1644  alloc_gfp等于flags
1649  page等于Slab allocation and freeing
1650  如果此条件成立可能性小(为编译器优化)(!page)则转到:out
1652  stat(s, Number of times fallback was necessary )
1655  objects等于oo_objects(oo)
1657  用于SLUB分配器,指向slab的指针等于s
1658  __SetPageSlab(page)
1659  如果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.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  如果非shuffle
1671  start等于fixup_red_left(s, start)
1672  start等于setup_object(s, page, start)
1673  first free object 等于start
1674 idx小于objects减1循环
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  如果gfpflags_allow_blocking(flags)则禁止中断()
1689  如果非page则返回:NULL
1692  inc_slabs_node(s, page_to_nid(page), objects)
1694  返回:page
调用者
名称描述
new_slab