Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\slab.c Create Date:2022-07-28 15:44:56
Last Modify:2022-05-23 17:02:55 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name: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.

Proto:static struct page *cache_grow_begin(struct kmem_cache *cachep, gfp_t flags, int nodeid)

Type:struct page

Parameter:

TypeParameterName
struct kmem_cache *cachep
gfp_tflags
intnodeid
2630  If Value for the false possibility is greater at compile time(flags & Do not use these with a slab allocator ) Then
2631  invalid_mask = flags & Do not use these with a slab allocator
2632  flags &= ~Do not use these with a slab allocator
2633  pr_warn("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  If gfpflags_allow_blocking(local_flags) Then The local_irq_*() APIs are equal to the raw_local_irq*()* if !TRACE_IRQFLAGS.()
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  If Not page Then Go to failed
2652  page_node = page_to_nid(page)
2653  n = get_node(cachep, page_node)
2656  colour_next++
2657  If colour_next >= colour Then colour_next = 0
2660  offset = colour_next
2661  If offset >= colour Then offset = 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  If OFF_SLAB(cachep) && Not freelist Then Go to 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  If gfpflags_allow_blocking(local_flags) Then local_irq_disable()
2686  Return page
2688  opps1 :
2689  Interface to system's page release.
2690  failed :
2691  If gfpflags_allow_blocking(local_flags) Then local_irq_disable()
2693  Return NULL
Caller
NameDescribe
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