函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\slab.c Create Date:2022-07-27 17:18:03
Last Modify:2022-05-23 17:02:55 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称: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.

函数原型:static size_t calculate_slab_order(struct kmem_cache *cachep, size_t size, slab_flags_t flags)

返回类型:size_t

参数:

类型参数名称
struct kmem_cache *cachep
size_tsize
slab_flags_tflags
1705  left_over等于0
1708 gfporder小于等于Maximum order allocatable via the slab allocagtor 循环
1712  num等于Calculate the number of objects and left-over bytes for a given buffer size.
1713  如果非num则继续下一循环
1717  如果num大于SLAB_OBJ_MAX_NUM退出
1720  如果flags按位与CFLGS_OFF_SLAB
1726  如果非freelist_cache则继续下一循环
1733  如果OFF_SLAB(freelist_cache)则继续下一循环
1742  num等于num
1743  gfporder等于gfporder
1744  left_over等于remainder
1751  如果flags按位与Objects are reclaimable 退出
1758  如果gfporder大于等于slab_max_order退出
1764  如果left_over乘8小于等于PAGE_SIZE左移gfporder位则退出
1767  返回:left_over
调用者
名称描述
set_objfreelist_slab_cache
set_off_slab_cache
set_on_slab_cache