Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name: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

Proto:static inline int build_detached_freelist(struct kmem_cache *s, size_t size, void **p, struct detached_freelist *df)

Type:int

Parameter:

TypeParameterName
struct kmem_cache *s
size_tsize
void **p
struct detached_freelist *df
3050  first_skipped_index = 0
3051  lookahead = 3
3056  page = NULL
3058  Do
3059  object = p[--size]
3061  When Not object && size cycle
3063  If Not object Then Return 0
3066  page = virt_to_head_page(object)
3067  If Not s Then
3071  kfree_hook(object)
3073  p[size] = NULL
3074  Return size
3077  s = not slob
3078  Else
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  When size cycle
3091  object = p[--size]
3092  If Not object Then Continue
3096  If page == virt_to_head_page(object) Then
3099  freelist = object
3100  cnt++
3101  p[size] = NULL
3103  Continue
3107  If Not --lookahead Then Break
3110  If Not first_skipped_index Then first_skipped_index = size + 1
3114  Return first_skipped_index
Caller
NameDescribe
kmem_cache_free_bulkNote that interrupts must be enabled when calling this function.