On Thu, 14 Jun 2012, Glauber Costa wrote: > On 06/13/2012 07:25 PM, Christoph Lameter wrote: > > - cache_cache.object_size = cache_cache.size; > > - cache_cache.size = ALIGN(cache_cache.size, > > + kmem_cache->size = kmem_cache->size; > > You actually mean kmem_cache->object_size = kmem_cache->size. > Besides size = size making no sense, This had the effect for me to have > allocations that were supposed to be zeroed not being so particularly in the > edges of the objects. Correct. Subject: [slab] Provide correct reference to object size Signed-off-by: Christoph Lameter <cl@xxxxxxxxx> Index: linux-2.6/mm/slab.c =================================================================== --- linux-2.6.orig/mm/slab.c 2012-06-14 03:10:09.002709496 -0500 +++ linux-2.6/mm/slab.c 2012-06-14 03:10:02.478709623 -0500 @@ -1496,8 +1496,8 @@ void __init kmem_cache_init(void) */ kmem_cache->size = offsetof(struct kmem_cache, array[nr_cpu_ids]) + nr_node_ids * sizeof(struct kmem_list3 *); - kmem_cache->size = kmem_cache->size; - kmem_cache->size = ALIGN(kmem_cache->size, + kmem_cache->object_size = kmem_cache->size; + kmem_cache->size = ALIGN(kmem_cache->object_size, cache_line_size()); kmem_cache->reciprocal_buffer_size = reciprocal_value(kmem_cache->size); -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@xxxxxxxxx. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@xxxxxxxxx"> email@xxxxxxxxx </a>