Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

slab: avoid double initialization & do initialization in 1 place

- alloc_slabmgmt: initialize all slab fields in 1 place
- 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>
Reviewed-by: Pekka Enberg <penberg@cs.helsinki.fi>
Signed-off-by: Christoph Lameter <clameter@sgi.com>

authored by

Marcin Slusarz and committed by
Christoph Lameter
e51bfd0a e760e716

+1 -2
+1 -2
mm/slab.c
··· 2630 2630 slabp->colouroff = colour_off; 2631 2631 slabp->s_mem = objp + colour_off; 2632 2632 slabp->nodeid = nodeid; 2633 + slabp->free = 0; 2633 2634 return slabp; 2634 2635 } 2635 2636 ··· 2684 2683 slab_bufctl(slabp)[i] = i + 1; 2685 2684 } 2686 2685 slab_bufctl(slabp)[i - 1] = BUFCTL_END; 2687 - slabp->free = 0; 2688 2686 } 2689 2687 2690 2688 static void kmem_flagcheck(struct kmem_cache *cachep, gfp_t flags) ··· 2816 2816 if (!slabp) 2817 2817 goto opps1; 2818 2818 2819 - slabp->nodeid = nodeid; 2820 2819 slab_map_pages(cachep, slabp, objp); 2821 2820 2822 2821 cache_init_objs(cachep, slabp);