kernel 3.10使用slub,不是slab
文件
Slub.c (android\kernel\mm)
Slab_common.c (android\kernel\mm)
-------全局变量和接口----------------
/*Slab cache management.*/
struct kmem_cache {
struct kmem_cache_cpu __percpu *cpu_slab; //每CPU变量,只保留一个slab,当没有空闲内存的情况下才会从kmem_cache_node中换出其他的slab。
/* Used for retriving partial slabs etc */
unsigned long flags;
unsigned long min_partial;
int size; /* The size of an object including meta data,meta data一般是个4字节的指针,用于指向下一个空闲的object,从而形成一个object的链表*/
int object_size; /* The size of an object without meta data , 该slab cache中的每个slab的大小,单位是字节 */
int offset; /* Free pointer offset. 重要,空闲的object的偏移量*/
int cpu_partial; /* Number of per cpu partial objects to keep around */
struct kmem_cache_order_objects oo;
/* Allocation and freeing of slabs */
struct kmem_cache_order_objects max;
struct kmem_cache_order_objects min;
gfp_t allocflags; /* gfp flags to use on each alloc */
int refcou
内存管理之SLUB
最新推荐文章于 2022-04-19 17:00:31 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)