--- slab.c.00 Tue Sep 5 12:49:16 2000 +++ slab.c Tue Sep 5 12:51:36 2000 @@ -424,14 +424,17 @@ */ void __init kmem_cache_sizes_init(void) { + unsigned int limit_found; cache_sizes_t *sizes = cache_sizes; char name[20]; + /* * 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; + limit_found = 0; do { /* For performance, all the general caches are L1 aligned. * This should be particularly beneficial on SMP boxes, as it @@ -446,9 +449,12 @@ } /* Inc off-slab bufctl limit until the ceiling is hit. */ - if (!(OFF_SLAB(sizes->cs_cachep))) { - offslab_limit = sizes->cs_size-sizeof(slab_t); - offslab_limit /= 2; + if (limit_found == 0) { + if (!(OFF_SLAB(sizes->cs_cachep))) { + offslab_limit = sizes->cs_size-sizeof(slab_t); + offslab_limit /= 2; + } else + limit_found = 1; } sprintf(name, "size-%Zd(DMA)",sizes->cs_size); sizes->cs_dmacachep = kmem_cache_create(name, sizes->cs_size, 0,