Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:calculate_order

Proto:static inline int calculate_order(unsigned int size)

Type:int

Parameter:

TypeParameterName
unsigned intsize
3286  min_objects = slub_min_objects
3287  If Not min_objects Then min_objects = 4 * (ls - find last set bit in word*@x: the word to search* This is defined in a similar way as the libc and compiler builtin* ffs, but returns the position of the most significant set bit.* fls(value) returns 0 if value is 0 or the position of the last + 1)
3289  max_objects = order_objects(slub_max_order, size)
3290  min_objects = min - return minimum of two values of the same or compatible types*@x: first value*@y: second value(min_objects, max_objects)
3292  When min_objects > 1 cycle
3295  fraction = 16
3296  When fraction >= 4 cycle
3299  If order <= slub_max_order Then Return order
3301  fraction /= 2
3303  min_objects--
3310  order = Calculate the order of allocation given an slab object size.* The order of allocation has significant impact on performance and other* system components. Generally order 0 allocations should be preferred since
3311  If order <= slub_max_order Then Return order
3317  order = Calculate the order of allocation given an slab object size.* The order of allocation has significant impact on performance and other* system components. Generally order 0 allocations should be preferred since
3318  If order < Free memory management - zoned buddy allocator. Then Return order
3320  Return -ENOSYS
Caller
NameDescribe
calculate_sizesalculate_sizes() determines the order and the distribution of data within* a slab object.