Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:alculate_slab_order - calculate size (page order) of slabs*@cachep: pointer to the cache that is being created*@size: size of objects to be created in this cache.*@flags: slab allocation flags* Also calculates the number of objects per slab.

Proto:static size_t calculate_slab_order(struct kmem_cache *cachep, size_t size, slab_flags_t flags)

Type:size_t

Parameter:

TypeParameterName
struct kmem_cache *cachep
size_tsize
slab_flags_tflags
1705  left_over = 0
1708  When gfporder <= Maximum order allocatable via the slab allocagtor cycle
1712  num = Calculate the number of objects and left-over bytes for a given buffer size.
1713  If Not num Then Continue
1717  If num > SLAB_OBJ_MAX_NUM Then Break
1720  If flags & CFLGS_OFF_SLAB Then
1726  If Not freelist_cache Then Continue
1733  If OFF_SLAB(freelist_cache) Then Continue
1742  num = num
1743  gfporder = gfporder
1744  left_over = remainder
1751  If flags & Objects are reclaimable Then Break
1758  If gfporder >= slab_max_order Then Break
1764  If left_over * 8 <= PAGE_SIZE << gfporder Then Break
1767  Return left_over
Caller
NameDescribe
set_objfreelist_slab_cache
set_off_slab_cache
set_on_slab_cache