From edb55f1642fcd9a5a009d7807cde8b0cf97ecc37 Mon Sep 17 00:00:00 2001 From: Christoph Lameter Date: Fri, 4 Apr 2008 11:12:33 -0700 Subject: slub: Fixes to per cpu stat output in sysfs Only output per cpu stats if the kernel is build for SMP. Use a capital "C" as a leading character for the processor number (same as the numa statistics that also use a capital letter "N"). Signed-off-by: Christoph Lameter --- mm/slub.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) Index: linux-2.6/mm/slub.c =================================================================== --- linux-2.6.orig/mm/slub.c 2008-04-04 11:48:13.000000000 -0700 +++ linux-2.6/mm/slub.c 2008-04-04 11:50:29.000000000 -0700 @@ -3979,10 +3979,12 @@ static int show_stat(struct kmem_cache * len = sprintf(buf, "%lu", sum); +#ifdef CONFIG_SMP for_each_online_cpu(cpu) { if (data[cpu] && len < PAGE_SIZE - 20) - len += sprintf(buf + len, " c%d=%u", cpu, data[cpu]); + len += sprintf(buf + len, " C%d=%u", cpu, data[cpu]); } +#endif kfree(data); return len + sprintf(buf + len, "\n"); }