Skip to content

Commit

Permalink
slub: Fixes to per cpu stat output in sysfs
Browse files Browse the repository at this point in the history
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 <clameter@sgi.com>
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
  • Loading branch information
Christoph Lameter authored and Pekka Enberg committed Apr 14, 2008
1 parent 5b06c85 commit 50ef37b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion mm/slub.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
Expand Down

0 comments on commit 50ef37b

Please sign in to comment.