Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

SLUB: slabinfo fixes

Align the output of % with K/M/G of sizes.

Check for empty NUMA information to avoid segfault on !NUMA.

-r should work directly not only if we match a single slab
without additional options.

Signed-off-by: Christoph Lameter <clameter@sgi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Christoph Lameter and committed by
Linus Torvalds
eefaca9c ade3aff2

+12 -5
+12 -5
Documentation/vm/slabinfo.c
··· 242 242 243 243 memset(numa, 0, MAX_NODES * sizeof(int)); 244 244 245 + if (!t) 246 + return; 247 + 245 248 while (*t == 'N') { 246 249 t++; 247 250 node = strtoul(t, &t, 10); ··· 389 386 { 390 387 if (strcmp(s->name, "*") == 0) 391 388 return; 392 - printf("\nSlabcache: %-20s Aliases: %2d Order : %2d\n", s->name, s->aliases, s->order); 389 + 390 + printf("\nSlabcache: %-20s Aliases: %2d Order : %2d Objects: %d\n", 391 + s->name, s->aliases, s->order, s->objects); 393 392 if (s->hwcache_align) 394 393 printf("** Hardware cacheline aligned\n"); 395 394 if (s->cache_dma) ··· 796 791 797 792 store_size(b1, total_size);store_size(b2, total_waste); 798 793 store_size(b3, total_waste * 100 / total_used); 799 - printf("Memory used: %6s # Loss : %6s MRatio: %6s%%\n", b1, b2, b3); 794 + printf("Memory used: %6s # Loss : %6s MRatio:%6s%%\n", b1, b2, b3); 800 795 801 796 store_size(b1, total_objects);store_size(b2, total_partobj); 802 797 store_size(b3, total_partobj * 100 / total_objects); 803 - printf("# Objects : %6s # PartObj: %6s ORatio: %6s%%\n", b1, b2, b3); 798 + printf("# Objects : %6s # PartObj: %6s ORatio:%6s%%\n", b1, b2, b3); 804 799 805 800 printf("\n"); 806 801 printf("Per Cache Average Min Max Total\n"); ··· 823 818 store_size(b1, avg_ppart);store_size(b2, min_ppart); 824 819 store_size(b3, max_ppart); 825 820 store_size(b4, total_partial * 100 / total_slabs); 826 - printf("%%PartSlab %10s%% %10s%% %10s%% %10s%%\n", 821 + printf("%%PartSlab%10s%% %10s%% %10s%% %10s%%\n", 827 822 b1, b2, b3, b4); 828 823 829 824 store_size(b1, avg_partobj);store_size(b2, min_partobj); ··· 835 830 store_size(b1, avg_ppartobj);store_size(b2, min_ppartobj); 836 831 store_size(b3, max_ppartobj); 837 832 store_size(b4, total_partobj * 100 / total_objects); 838 - printf("%% PartObj %10s%% %10s%% %10s%% %10s%%\n", 833 + printf("%% PartObj%10s%% %10s%% %10s%% %10s%%\n", 839 834 b1, b2, b3, b4); 840 835 841 836 store_size(b1, avg_size);store_size(b2, min_size); ··· 1105 1100 ops(slab); 1106 1101 else if (show_slab) 1107 1102 slabcache(slab); 1103 + else if (show_report) 1104 + report(slab); 1108 1105 } 1109 1106 } 1110 1107