函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\slob.c Create Date:2022-07-27 17:09:40
Last Modify:2022-05-20 09:26:42 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:End of slob allocator proper. Begin kmem_cache_alloc and kmalloc frontend.

函数原型:static __always_inline void *__do_kmalloc_node(size_t size, gfp_t gfp, int node, unsigned long caller)

返回类型:void

参数:

类型参数名称
size_tsize
gfp_tgfp
intnode
unsigned longcaller
472  minalign等于max_t - return maximum of two values, using the specified type*@type: data type to use*@x: first value*@y: second value(size_t, ARCH_KMALLOC_MINALIGN, Setting ARCH_SLAB_MINALIGN in arch headers allows a different alignment.* Intended for arches that get misalignment faults even for 64 bit integer* aligned buffers.)
475  gfp与等于gfp_allowed_mask
477  fs_reclaim_acquire(gfp)
478  fs_reclaim_release(gfp)
480  如果size小于PAGE_SIZEminalign
481  align等于minalign
487  如果s_power_of_2() - check if a value is a power of two*@n: the value to check* Determine whether some value is a power of two, where zero is* *not* considered a power of two.* Return: true if @n is a power of 2, otherwise false.align等于两数取大(minalign, (int)size)
490  如果非size则返回:ZERO_SIZE_PTR will be returned for zero sized kmalloc requests.* Dereferencing ZERO_SIZE_PTR will lead to a distinct access fault.* ZERO_SIZE_PTR can be passed to kfree though in the same way that NULL can.* Both make kfree a no-op.
493  m等于slob_alloc: entry point into the slob allocator.
495  如果非m则返回:NULL
497  m等于size
498  ret等于mminalign
500  trace_kmalloc_node(caller, ret, size, size + minalign, gfp, node)
502  否则
503  order等于get_order - Determine the allocation order of a memory size*@size: The size for which to get the order* Determine the allocation order of a particular sized block of memory
505  如果此条件成立可能性大(为编译器优化)(order)则gfp或等于__GFP_COMP
507  ret等于slob_new_pages(gfp, order, node)
509  trace_kmalloc_node(caller, ret, size, PAGE_SIZE << order, gfp, node)
513  kmemleak_alloc(ret, size, 1, gfp)
514  返回:ret
调用者
名称描述
__kmalloc开辟内存
__kmalloc_track_caller
__kmalloc_node_track_caller
__kmalloc_node