函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\slab.c Create Date:2022-07-27 17:18:38
Last Modify:2022-05-23 17:02:55 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:Get the memory for a slab management obj.* For a slab cache when the slab descriptor is off-slab, the* slab descriptor can't come from the same cache which is being created,* Because if it is the case, that means we defer the creation of

函数原型:static void *alloc_slabmgmt(struct kmem_cache *cachep, struct page *page, int colour_off, gfp_t local_flags, int nodeid)

返回类型:void

参数:

类型参数名称
struct kmem_cache *cachep
struct page *page
intcolour_off
gfp_tlocal_flags
intnodeid
2347  addr等于page_address(page)
2349  slab: first object 等于addrcolour_off
2350  SLAB 等于0
2352  如果OBJFREELIST_SLAB(cachep)则freelist = NULL
2354  否则如果OFF_SLAB(cachep)则
2356  freelist等于在指定节点上分配一个对象
2358  如果非freelist则返回:NULL
2360  否则
2362  freelist等于addrPAGE_SIZE左移gfporder位的值减freelist_size
2366  返回:freelist
调用者
名称描述
cache_grow_beginGrow (by 1) the number of slabs within a cache. This is called by* kmem_cache_alloc() when there are no active objs left in a cache.