/* 5) resize the head arrays to their final sizes */ 
for_each_online_node(node) { init_list(malloc_sizes[INDEX_AC].cs_cachep, &initkmem_list3[SIZE_AC+node], node);  if (INDEX_AC != INDEX_L3) { init_list(malloc_sizes[INDEX_L3].cs_cachep, &initkmem_list3[SIZE_L3+node], node); } } }  /* 6) resize the head arrays to their final sizes */ 
void __init kmem_cache_init(void){	size_t left_over;	struct cache_sizes *sizes;	struct cache_names *names;	/*	 * Fragmentation resistance on low memory - only use bigger	 * page orders on machines with more than 32MB of memory.	 */	if (num_physpages > (32 << 20) >> PAGE_SHIFT)		slab_break_gfp_order = BREAK_GFP_ORDER_HI;		/* Bootstrap is tricky, because several objects are allocated	 * from caches that do not exist yet:	 * 1) initialize the cache_cache cache: it contains the kmem_cache_t	 *    structures of all caches, except cache_cache itself: cache_cache	 *    is statically allocated.	 *    Initially an __init data area is used for the head array, it's	 *    replaced with a kmalloc allocated array at the end of the bootstrap.	 * 2) Create the first kmalloc cache.	 *    The kmem_cache_t for the new cache is allocated normally. An __init	 *    data area is used for the head array.	 * 3) Create the remaining kmalloc caches, with minimally sized head arrays.	 * 4) Replace the __init data head arrays for cache_cache and the first	 *    kmalloc cache with kmalloc allocated arrays.	 * 5) Resize the head arrays of the kmalloc caches to their final sizes.	 */	/* 1) create the cache_cache */	init_MUTEX(&cache_chain_sem);	INIT_LIST_HEAD(&cache_chain);	list_add(&cache_cache.next, &cache_chain);	cache_cache.colour_off = cache_line_size();	cache_cache.array[smp_processor_id()] = &initarray_cache.cache;	cache_cache.objsize = ALIGN(cache_cache.objsize, cache_line_size());	cache_estimate(0, cache_cache.objsize, cache_line_size(), 0,				&left_over, &cache_cache.num);	if (!cache_cache.num)		BUG();	cache_cache.colour = left_over/cache_cache.colour_off;	cache_cache.colour_next = 0;	cache_cache.slab_size = ALIGN(cache_cache.num*sizeof(kmem_bufctl_t) +				sizeof(struct slab), cache_line_size());	/* 2+3) create the kmalloc caches */	sizes = malloc_sizes;	names = cache_names;	while (sizes->cs_size != ULONG_MAX) {		/* For performance, all the general caches are L1 aligned.		 * This should be particularly beneficial on SMP boxes, as it		 * eliminates "false sharing".		 * Note for systems short on memory removing the alignment will		 * allow tighter packing of the smaller caches. */		sizes->cs_cachep = kmem_cache_create(names->name,			sizes->cs_size, ARCH_KMALLOC_MINALIGN,			(ARCH_KMALLOC_FLAGS | SLAB_PANIC), NULL, NULL);		/* Inc off-slab bufctl limit until the ceiling is hit. */		if (!(OFF_SLAB(sizes->cs_cachep))) {			offslab_limit = sizes->cs_size-sizeof(struct slab);			offslab_limit /= sizeof(kmem_bufctl_t);		}		sizes->cs_dmacachep = kmem_cache_create(names->name_dma,			sizes->cs_size, ARCH_KMALLOC_MINALIGN,			(ARCH_KMALLOC_FLAGS | SLAB_CACHE_DMA | SLAB_PANIC),			NULL, NULL);		sizes++;		names++;	}	/* 4) Replace the bootstrap head arrays */	{		void * ptr;				ptr = kmalloc(sizeof(struct arraycache_init), GFP_KERNEL);		local_irq_disable();		BUG_ON(ac_data(&cache_cache) != &initarray_cache.cache);		memcpy(ptr, ac_data(&cache_cache), sizeof(struct arraycache_init));		cache_cache.array[smp_processor_id()] = ptr;		local_irq_enable();			ptr = kmalloc(sizeof(struct arraycache_init), GFP_KERNEL);		local_irq_disable();		BUG_ON(ac_data(malloc_sizes[0].cs_cachep) != &initarray_generic.cache);		memcpy(ptr, ac_data(malloc_sizes[0].cs_cachep),				sizeof(struct arraycache_init));		malloc_sizes[0].cs_cachep->array[smp_processor_id()] = ptr;		local_irq_enable();	}	/* 5) resize the head arrays to their final sizes */	{		kmem_cache_t *cachep;		down(&cache_chain_sem);		list_for_each_entry(cachep, &cache_chain, next)			enable_cpucache(cachep);		up(&cache_chain_sem);	}	/* Done! */	g_cpucache_up = FULL;	/* Register a cpu startup notifier callback	 * that initializes ac_data for all new cpus	 */	register_cpu_notifier(&cpucache_notifier);		/* The reap timers are started later, with a module init call:	 * That part of the kernel is not yet operational.	 */}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/e498be7dafd72fd68848c1eef1575aa7c5d658df/slab.c/clean/mm/slab.c