Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:include\linux\slab_def.h Create Date:2022-07-28 14:03:52
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:We want to avoid an expensive divide : (offset / cache->size)* Using the fact that size is a constant for a particular cache,* we can replace (offset / cache->size) by* reciprocal_divide(offset, cache->reciprocal_buffer_size)

Proto:static inline unsigned int obj_to_index(const struct kmem_cache *cache, const struct page *page, void *obj)

Type:unsigned int

Parameter:

TypeParameterName
const struct kmem_cache *cache
const struct page *page
void *obj
113  offset = obj - slab: first object
114  Return reciprocal_divide(offset, reciprocal_buffer_size)
Caller
NameDescribe
slab_put_obj
assign_tagThis function assigns a tag to an object considering the following:* 1