slab: Make the fixed size of alien caches explicit We have had an implicit fixed size of the alien caches in the NUMA slab allocator from the beginning. Define this limit explicitly in a constant and remove the argument to alloc_alien cache that specifies the limit. Signed-off-by: Christoph Lameter Index: linux-2.6.18-rc3/mm/slab.c =================================================================== --- linux-2.6.18-rc3.orig/mm/slab.c 2006-08-03 22:51:02.708671592 -0700 +++ linux-2.6.18-rc3/mm/slab.c 2006-08-03 22:53:59.509252963 -0700 @@ -274,6 +274,12 @@ struct array_cache { }; /* + * The number of alien cache entries to use. This value has turned out + * to be sufficient. + */ +#define ALIEN_LIMIT 12 + +/* * bootstrap: The caches do not work without cpuarrays anymore, but the * cpuarrays are allocated from the generic caches... */ @@ -959,14 +965,12 @@ static int transfer_objects(struct array static void *__cache_alloc_node(struct kmem_cache *, gfp_t, int); static void *alternate_node_alloc(struct kmem_cache *, gfp_t); -static struct array_cache **alloc_alien_cache(int node, int limit) +static struct array_cache **alloc_alien_cache(int node) { struct array_cache **ac_ptr; int memsize = sizeof(void *) * MAX_NUMNODES; int i; - if (limit > 1) - limit = 12; ac_ptr = kmalloc_node(memsize, GFP_KERNEL, node); if (ac_ptr) { for_each_node(i) { @@ -974,7 +978,7 @@ static struct array_cache **alloc_alien_ ac_ptr[i] = NULL; continue; } - ac_ptr[i] = alloc_arraycache(node, limit, 0xbaadf00d); + ac_ptr[i] = alloc_arraycache(node, ALIEN_LIMIT, 0xbaadf00d); if (!ac_ptr[i]) { for (i--; i <= 0; i--) kfree(ac_ptr[i]); @@ -1090,7 +1094,7 @@ static inline int cache_free_alien(struc #define drain_alien_cache(cachep, alien) do { } while (0) #define reap_alien(cachep, l3) do { } while (0) -static inline struct array_cache **alloc_alien_cache(int node, int limit) +static inline struct array_cache **alloc_alien_cache(int node) { return (struct array_cache **) 0x01020304ul; } @@ -1173,7 +1177,7 @@ static int __devinit cpuup_callback(stru if (!shared) goto bad; - alien = alloc_alien_cache(node, cachep->limit); + alien = alloc_alien_cache(node); if (!alien) goto bad; cachep->array[cpu] = nc; @@ -3531,7 +3535,7 @@ static int alloc_kmemlist(struct kmem_ca for_each_online_node(node) { - new_alien = alloc_alien_cache(node, cachep->limit); + new_alien = alloc_alien_cache(node); if (!new_alien) goto fail;