From: Christoph Lameter Date: Mon, 14 Apr 2008 15:52:05 +0000 (+0300) Subject: slub: Fixes to per cpu stat output in sysfs X-Git-Tag: v2.6.26-rc1~1159^2~2 X-Git-Url: http://www.pilppa.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=50ef37b96c11e76625067ae413dc54585ea22585;p=linux-2.6-omap-h63xx.git 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 Signed-off-by: Pekka Enberg --- diff --git a/mm/slub.c b/mm/slub.c index 3fcdcf7d77b..23e5ee7b149 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -3979,10 +3979,12 @@ static int show_stat(struct kmem_cache *s, char *buf, enum stat_item si) 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"); }