Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\slob.c Create Date:2022-07-28 15:36:15
Last Modify:2022-05-20 09:26:42 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:End of slob allocator proper. Begin kmem_cache_alloc and kmalloc frontend.

Proto:static __always_inline void *__do_kmalloc_node(size_t size, gfp_t gfp, int node, unsigned long caller)

Type:void

Parameter:

TypeParameterName
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  If size < PAGE_SIZE - minalign Then
481  align = minalign
487  If 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. Then align = max - return maximum of two values of the same or compatible types*@x: first value*@y: second value(minalign, (int)size)
490  If Not size Then Return 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  If Not m Then Return NULL
497  m = size
498  ret = m + minalign
500  trace_kmalloc_node(caller, ret, size, size + minalign, gfp, node)
502  Else
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  If Value is more likely to compile time(order) Then 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  Return ret
Caller
NameDescribe
__kmalloc
__kmalloc_track_caller
__kmalloc_node_track_caller
__kmalloc_node