Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\slab_common.c Create Date:2022-07-28 14:29:14
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:Figure out what the alignment of the objects will be given a set of* flags, a user specified alignment and the size of the objects.

Proto:static unsigned int calculate_alignment(slab_flags_t flags, unsigned int align, unsigned int size)

Type:unsigned int

Parameter:

TypeParameterName
slab_flags_tflags
unsigned intalign
unsigned intsize
291  If flags & Align objs on cache lines Then
294  ralign = cache_line_size()
295  When size <= ralign / 2 cycle
296  ralign /= 2
297  align = max - return maximum of two values of the same or compatible types*@x: first value*@y: second value(align, ralign)
300  If align < 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. Then align = 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.
303  Return @a is a power of 2 value (align, size of * )
Caller
NameDescribe
find_mergeable
kmem_cache_create_usercopykmem_cache_create_usercopy - Create a cache with a region suitable* for copying to userspace*@name: A string which is used in /proc/slabinfo to identify this cache.*@size: The size of objects to be created in this cache.