diff options
author | Glauber Costa <glommer@parallels.com> | 2012-10-19 18:20:27 +0400 |
---|---|---|
committer | Pekka Enberg <penberg@kernel.org> | 2012-10-24 09:39:16 +0300 |
commit | 0d7561c61d76690ed84bd1016acc0fcbff063205 (patch) | |
tree | 90870a84e7568020921d01300e73cc607410ff47 /mm/slab_common.c | |
parent | bcee6e2a13d580f6c21d748fcd7239ccc66cb4b8 (diff) | |
download | kernel_goldelico_gta04-0d7561c61d76690ed84bd1016acc0fcbff063205.zip kernel_goldelico_gta04-0d7561c61d76690ed84bd1016acc0fcbff063205.tar.gz kernel_goldelico_gta04-0d7561c61d76690ed84bd1016acc0fcbff063205.tar.bz2 |
sl[au]b: Process slabinfo_show in common code
With all the infrastructure in place, we can now have slabinfo_show
done from slab_common.c. A cache-specific function is called to grab
information about the cache itself, since that is still heavily
dependent on the implementation. But with the values produced by it, all
the printing and handling is done from common code.
Signed-off-by: Glauber Costa <glommer@parallels.com>
CC: Christoph Lameter <cl@linux.com>
CC: David Rientjes <rientjes@google.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
Diffstat (limited to 'mm/slab_common.c')
-rw-r--r-- | mm/slab_common.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/mm/slab_common.c b/mm/slab_common.c index c64a043..5fb753d 100644 --- a/mm/slab_common.c +++ b/mm/slab_common.c @@ -242,7 +242,23 @@ static void s_stop(struct seq_file *m, void *p) static int s_show(struct seq_file *m, void *p) { - return slabinfo_show(m, p); + struct kmem_cache *s = list_entry(p, struct kmem_cache, list); + struct slabinfo sinfo; + + memset(&sinfo, 0, sizeof(sinfo)); + get_slabinfo(s, &sinfo); + + seq_printf(m, "%-17s %6lu %6lu %6u %4u %4d", + s->name, sinfo.active_objs, sinfo.num_objs, s->size, + sinfo.objects_per_slab, (1 << sinfo.cache_order)); + + seq_printf(m, " : tunables %4u %4u %4u", + sinfo.limit, sinfo.batchcount, sinfo.shared); + seq_printf(m, " : slabdata %6lu %6lu %6lu", + sinfo.active_slabs, sinfo.num_slabs, sinfo.shared_avail); + slabinfo_show_stats(m, s); + seq_putc(m, '\n'); + return 0; } /* |