From: Christoph Lameter On third thought: The trouble with this solution is that we will now set the order to that used by the largest kmalloc cache. Bad... this could be 6 on i386 to 13 if CONFIG_LARGE_ALLOCs is set. The large kmalloc caches are rarely used and we are used to OOMing if those are utilized to frequently. I guess we should only set this for non kmalloc caches then. So move the call into kmem_cache_create? Would make the min order 3 on most of my mm machines. Signed-off-by: Christoph Lameter Cc: Andy Whitcroft Cc: Mel Gorman Signed-off-by: Andrew Morton --- mm/slub.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff -puN mm/slub.c~have-kswapd-keep-a-minimum-order-free-other-than-order-0-fix mm/slub.c --- a/mm/slub.c~have-kswapd-keep-a-minimum-order-free-other-than-order-0-fix +++ a/mm/slub.c @@ -2006,8 +2006,6 @@ static int kmem_cache_open(struct kmem_c #ifdef CONFIG_NUMA s->defrag_ratio = 100; #endif - raise_kswapd_order(s->order); - if (init_kmem_cache_nodes(s, gfpflags & ~SLUB_DMA)) return 1; error: @@ -2561,6 +2559,7 @@ struct kmem_cache *kmem_cache_create(con goto err; } list_add(&s->list, &slab_caches); + raise_kswapd_order(s->order); } else kfree(s); } _