kmem_cache如下: 62struct kmem_cache { struct kmem_cache_cpu __percpu *cpu_slab; /* Used for retriving partial slabs etc */ unsigned long flags; unsigned long min_partial; int size; /* The size of an object including meta data */ int object_size; /* The…
在numa架构下,slab分配object: 3192static __always_inline void * 3193__do_cache_alloc(struct kmem_cache *cache, gfp_t flags) { objp = ____cache_alloc(cache, flags); /* 3205 * We may just have run out of memory on the local node. 3206 * ____cache_alloc_node()…
本文转载自:http://blog.chinaunix.net/uid-26859697-id-5573776.html kmalloc()是基于slab/slob/slub分配分配算法上实现的,不少地方将其作为slab/slob/slub分配算法的入口,实际上是略有区别的. 现在分析一下其实现: [file:/include/linux/slab.h] /** * kmalloc - allocate memory * @size: how many bytes of memory are r…