[PATCH] use SLAB_PANIC for general caches

From: Brian Gerst
Date: Thu May 27 2004 - 07:53:42 EST


Initialize the general caches using SLAB_PANIC instead of BUG().

--
Brian Gerst
diff -urN linux-2.6.7-rc1-bk/mm/slab.c linux/mm/slab.c
--- linux-2.6.7-rc1-bk/mm/slab.c 2004-05-23 18:41:51.000000000 -0400
+++ linux/mm/slab.c 2004-05-27 08:49:05.444639592 -0400
@@ -754,11 +754,9 @@
* 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, 0, NULL, NULL);
- if (!sizes->cs_cachep)
- BUG();
+ sizes->cs_cachep = kmem_cache_create(names->name,
+ sizes->cs_size, ARCH_KMALLOC_MINALIGN,
+ SLAB_PANIC, NULL, NULL);

/* Inc off-slab bufctl limit until the ceiling is hit. */
if (!(OFF_SLAB(sizes->cs_cachep))) {
@@ -766,11 +764,9 @@
offslab_limit /= sizeof(kmem_bufctl_t);
}

- sizes->cs_dmacachep = kmem_cache_create(
- names->name_dma, sizes->cs_size,
- ARCH_KMALLOC_MINALIGN, SLAB_CACHE_DMA, NULL, NULL);
- if (!sizes->cs_dmacachep)
- BUG();
+ sizes->cs_dmacachep = kmem_cache_create(names->name_dma,
+ sizes->cs_size, ARCH_KMALLOC_MINALIGN,
+ (SLAB_CACHE_DMA | SLAB_PANIC), NULL, NULL);

sizes++;
names++;