函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\slub.c Create Date:2022-07-27 17:22:40
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:This function progressively scans the array with free objects (with* a limited look ahead) and extract objects belonging to the same* page. It builds a detached freelist directly within the given* page/objects. This can happen without any need for

函数原型:static inline int build_detached_freelist(struct kmem_cache *s, size_t size, void **p, struct detached_freelist *df)

返回类型:int

参数:

类型参数名称
struct kmem_cache *s
size_tsize
void **p
struct detached_freelist *df
3050  first_skipped_index等于0
3051  lookahead等于3
3056  page = NULL
3058  循环
3059  object等于p[--size]
3061  当非objectsize循环
3063  如果非object则返回:0
3066  page等于virt_to_head_page(object)
3067  如果非s
3071  kfree_hook(object)
3073  p[size] = NULL
3074  返回:size
3077  s等于用于SLUB分配器,指向slab的指针
3078  否则
3079  s等于cache_from_obj(s, object)
3083  page等于page
3084  set_freepointer(s, object, NULL)
3085  tail等于object
3086  freelist等于object
3087  p[size] = NULL
3088  cnt等于1
3090 size循环
3091  object等于p[--size]
3092  如果非object则继续下一循环
3096  如果page恒等于virt_to_head_page(object)则
3099  freelist等于object
3100  cnt自加
3101  p[size] = NULL
3103  继续下一循环
3107  如果非lookahead先自减则退出
3110  如果非first_skipped_indexfirst_skipped_index等于size加1
3114  返回:first_skipped_index
调用者
名称描述
kmem_cache_free_bulkNote that interrupts must be enabled when calling this function.