函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:Calculate the number of objects and left-over bytes for a given buffer size.

函数原型:static unsigned int cache_estimate(unsigned long gfporder, size_t buffer_size, slab_flags_t flags, size_t *left_over)

返回类型:unsigned int

参数:

类型参数名称
unsigned longgfporder
size_tbuffer_size
slab_flags_tflags
size_t *left_over
452  slab_size等于PAGE_SIZE左移gfporder
471  如果flags按位与CFLGS_OBJFREELIST_SLAB按位或CFLGS_OFF_SLAB的值则
472  num等于slab_sizebuffer_size
473  left_over等于slab_size取模buffer_size
474  否则
475  num等于slab_sizebuffer_sizesizeof(freelist_idx_t)的和
476  left_over等于slab_size取模buffer_sizesizeof(freelist_idx_t)的和
480  返回:num
调用者
名称描述
calculate_slab_orderalculate_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.