SLUB: Show debug options on bootup. Its useful to see the debug options that were enabled if someone sends us a boot log. Signed-off-by: Christoph Lameter Index: linux-2.6.21-rc6/mm/slub.c =================================================================== --- linux-2.6.21-rc6.orig/mm/slub.c 2007-04-12 18:24:03.000000000 -0700 +++ linux-2.6.21-rc6/mm/slub.c 2007-04-12 18:24:21.000000000 -0700 @@ -1439,7 +1439,7 @@ static int slub_nomerge; * Debug settings: */ static int slub_debug; - +static char slub_parameter[20]; static char *slub_debug_slabs; /* @@ -1941,38 +1941,42 @@ __setup("slub_nomerge", setup_slub_nomer static int __init setup_slub_debug(char *str) { if (!str || *str != '=') - slub_debug = DEBUG_DEFAULT_FLAGS; - else { - str++; - if (*str == 0 || *str == ',') - slub_debug = DEBUG_DEFAULT_FLAGS; - else - for( ;*str && *str != ','; str++) - switch (*str) { - case 'f' : case 'F' : - slub_debug |= SLAB_DEBUG_FREE; - break; - case 'z' : case 'Z' : - slub_debug |= SLAB_RED_ZONE; - break; - case 'p' : case 'P' : - slub_debug |= SLAB_POISON; - break; - case 'u' : case 'U' : - slub_debug |= SLAB_STORE_USER; - break; - case 't' : case 'T' : - slub_debug |= SLAB_TRACE; - break; - default: - printk(KERN_ERR "slub_debug option '%c' " - "unknown. skipped\n",*str); - } - } + goto default_debug; + + str++; + if (*str == 0 || *str == ',') + goto default_debug; + + memcpy(slub_parameter, str, sizeof(slub_parameter) - 1); + for( ;*str && *str != ','; str++) + switch (*str) { + case 'f' : case 'F' : + slub_debug |= SLAB_DEBUG_FREE; + break; + case 'z' : case 'Z' : + slub_debug |= SLAB_RED_ZONE; + break; + case 'p' : case 'P' : + slub_debug |= SLAB_POISON; + break; + case 'u' : case 'U' : + slub_debug |= SLAB_STORE_USER; + break; + case 't' : case 'T' : + slub_debug |= SLAB_TRACE; + break; + default: + printk(KERN_ERR "slub_debug option '%c' " + "unknown. skipped\n",*str); + } if (*str == ',') slub_debug_slabs = str + 1; return 1; +default_debug: + slub_debug = DEBUG_DEFAULT_FLAGS; + memcpy(slub_parameter, "FZUP", 5); + return 1; } __setup("slub_debug", setup_slub_debug); @@ -2206,9 +2210,10 @@ void __init kmem_cache_init(void) + nr_cpu_ids * sizeof(struct page *); printk(KERN_INFO "SLUB: General Slabs=%d, HW alignment=%d, " - "Processors=%d, Nodes=%d\n", + "Processors=%d, Nodes=%d Debug=%s\n", KMALLOC_SHIFT_HIGH, L1_CACHE_BYTES, - nr_cpu_ids, nr_node_ids); + nr_cpu_ids, nr_node_ids, + slub_parameter); } /*