Re: Common [14/20] Always use the name "kmem_cache" for the slab cache with the kmem_cache structure.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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>


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]