All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] slab: avoid double initialization & do it in 1 function
@ 2007-12-27 20:28 Marcin Slusarz
  2007-12-29  8:49 ` Pekka J Enberg
  0 siblings, 1 reply; 2+ messages in thread
From: Marcin Slusarz @ 2007-12-27 20:28 UTC (permalink / raw)
  To: LKML; +Cc: Christoph Lameter, Pekka Enberg

* alloc_slabmgmt: initialize all slab fields in 1 function
* slab->nodeid was initialized twice: in alloc_slabmgmt
  and immediately after it in cache_grow

Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
CC: Christoph Lameter <clameter@sgi.com>
CC: Pekka Enberg <penberg@cs.helsinki.fi>
diff --git a/mm/slab.c b/mm/slab.c
index 2e338a5..458b07a 100644
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -2626,6 +2626,7 @@ static struct slab *alloc_slabmgmt(struct kmem_cache *cachep, void *objp,
 	slabp->colouroff = colour_off;
 	slabp->s_mem = objp + colour_off;
 	slabp->nodeid = nodeid;
+	slabp->free = 0;
 	return slabp;
 }
 
@@ -2679,7 +2680,6 @@ static void cache_init_objs(struct kmem_cache *cachep,
 		slab_bufctl(slabp)[i] = i + 1;
 	}
 	slab_bufctl(slabp)[i - 1] = BUFCTL_END;
-	slabp->free = 0;
 }
 
 static void kmem_flagcheck(struct kmem_cache *cachep, gfp_t flags)
@@ -2812,7 +2812,6 @@ static int cache_grow(struct kmem_cache *cachep,
 	if (!slabp)
 		goto opps1;
 
-	slabp->nodeid = nodeid;
 	slab_map_pages(cachep, slabp, objp);
 
 	cache_init_objs(cachep, slabp);

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-12-29  8:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-12-27 20:28 [PATCH] slab: avoid double initialization & do it in 1 function Marcin Slusarz
2007-12-29  8:49 ` Pekka J Enberg

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.