函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:Grow (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.

函数原型:static struct page *cache_grow_begin(struct kmem_cache *cachep, gfp_t flags, int nodeid)

返回类型:struct page

参数:

类型参数名称
struct kmem_cache *cachep
gfp_tflags
intnodeid
2630  如果此条件成立可能性小(为编译器优化)(flags & Do not use these with a slab allocator )则
2631  invalid_mask等于flags按位与Do not use these with a slab allocator
2632  flags与等于Do not use these with a slab allocator 的反
2633  打印警告信息("Unexpected gfp: %#x (%pGg). Fixing up to gfp: %#x (%pGg). Fix your code!\n", invalid_mask, & invalid_mask, flags, & flags)
2635  dump_stack()
2637  WARN_ON_ONCE(ctor && (flags & __GFP_ZERO))
2638  local_flags等于flags按位与Control allocation cpuset and node placement constraints 按位或The set of flags that only affect watermark checking and reclaim* behaviour. This is used by the MM to obey the caller constraints* about IO, FS and watermark checking while ignoring placement* hints such as HIGHMEM usage.的值
2640  check_irq_off()
2641  如果gfpflags_allow_blocking(local_flags)则开中断()
2648  page等于Interface to system's page allocator. No need to hold the* kmem_cache_node ->list_lock.* If we requested dmaable memory, we will get it. Even if we* did not request dmaable memory, we might get it, but that* would be relatively rare and ignorable.
2649  如果非page则转到:failed
2652  page_node等于page_to_nid(page)
2653  n等于get_node(cachep, page_node)
2656  colour_next自加
2657  如果colour_next大于等于colourcolour_next等于0
2660  offset等于colour_next
2661  如果offset大于等于colouroffset等于0
2664  offset乘等于colour_off
2671  kasan_poison_slab(page)
2674  freelist等于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
2676  如果OFF_SLAB(cachep)且非freelist则转到:opps1
2679  Map pages beginning at addr to the given cache and slab. This is required* for the slab allocator to be able to lookup the cache and slab of a* virtual address for kfree, ksize, and slab debugging.
2681  cache_init_objs(cachep, page)
2683  如果gfpflags_allow_blocking(local_flags)则禁止中断()
2686  返回:page
2688  opps1 :
2689  Interface to system's page release.
2690  failed :
2691  如果gfpflags_allow_blocking(local_flags)则禁止中断()
2693  返回:NULL
调用者
名称描述
cache_alloc_refill
fallback_allocFallback function if there was no memory available and no objects on a* certain node and fall back is permitted. First we scan all the* available node for available objects. If that fails then we* perform an allocation without specifying a node
____cache_alloc_nodeA interface to enable slab creation on nodeid