aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/vm
diff options
context:
space:
mode:
authorChristoph Lameter <clameter@sgi.com>2008-04-14 12:11:40 -0400
committerPekka Enberg <penberg@cs.helsinki.fi>2008-04-27 11:28:17 -0400
commit205ab99dd103e3dd5b0964dad8a16dfe2db69b2e (patch)
tree026a601ea25681cbf34f37360880f78a305a32f5 /Documentation/vm
parent834f3d119234b35a1985a2449831d99356637937 (diff)
slub: Update statistics handling for variable order slabs
Change the statistics to consider that slabs of the same slabcache can have different number of objects in them since they may be of different order. Provide a new sysfs field total_objects which shows the total objects that the allocated slabs of a slabcache could hold. Add a max field that holds the largest slab order that was ever used for a slab cache. Signed-off-by: Christoph Lameter <clameter@sgi.com> Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Diffstat (limited to 'Documentation/vm')
-rw-r--r--Documentation/vm/slabinfo.c27
1 files changed, 11 insertions, 16 deletions
diff --git a/Documentation/vm/slabinfo.c b/Documentation/vm/slabinfo.c
index 22d7e3e4d60c..d3ce295bffac 100644
--- a/Documentation/vm/slabinfo.c
+++ b/Documentation/vm/slabinfo.c
@@ -31,7 +31,7 @@ struct slabinfo {
31 int hwcache_align, object_size, objs_per_slab; 31 int hwcache_align, object_size, objs_per_slab;
32 int sanity_checks, slab_size, store_user, trace; 32 int sanity_checks, slab_size, store_user, trace;
33 int order, poison, reclaim_account, red_zone; 33 int order, poison, reclaim_account, red_zone;
34 unsigned long partial, objects, slabs; 34 unsigned long partial, objects, slabs, objects_partial, objects_total;
35 unsigned long alloc_fastpath, alloc_slowpath; 35 unsigned long alloc_fastpath, alloc_slowpath;
36 unsigned long free_fastpath, free_slowpath; 36 unsigned long free_fastpath, free_slowpath;
37 unsigned long free_frozen, free_add_partial, free_remove_partial; 37 unsigned long free_frozen, free_add_partial, free_remove_partial;
@@ -540,7 +540,8 @@ void slabcache(struct slabinfo *s)
540 return; 540 return;
541 541
542 store_size(size_str, slab_size(s)); 542 store_size(size_str, slab_size(s));
543 snprintf(dist_str, 40, "%lu/%lu/%d", s->slabs, s->partial, s->cpu_slabs); 543 snprintf(dist_str, 40, "%lu/%lu/%d", s->slabs - s->cpu_slabs,
544 s->partial, s->cpu_slabs);
544 545
545 if (!line++) 546 if (!line++)
546 first_line(); 547 first_line();
@@ -776,7 +777,6 @@ void totals(void)
776 unsigned long used; 777 unsigned long used;
777 unsigned long long wasted; 778 unsigned long long wasted;
778 unsigned long long objwaste; 779 unsigned long long objwaste;
779 long long objects_in_partial_slabs;
780 unsigned long percentage_partial_slabs; 780 unsigned long percentage_partial_slabs;
781 unsigned long percentage_partial_objs; 781 unsigned long percentage_partial_objs;
782 782
@@ -790,18 +790,11 @@ void totals(void)
790 wasted = size - used; 790 wasted = size - used;
791 objwaste = s->slab_size - s->object_size; 791 objwaste = s->slab_size - s->object_size;
792 792
793 objects_in_partial_slabs = s->objects -
794 (s->slabs - s->partial - s ->cpu_slabs) *
795 s->objs_per_slab;
796
797 if (objects_in_partial_slabs < 0)
798 objects_in_partial_slabs = 0;
799
800 percentage_partial_slabs = s->partial * 100 / s->slabs; 793 percentage_partial_slabs = s->partial * 100 / s->slabs;
801 if (percentage_partial_slabs > 100) 794 if (percentage_partial_slabs > 100)
802 percentage_partial_slabs = 100; 795 percentage_partial_slabs = 100;
803 796
804 percentage_partial_objs = objects_in_partial_slabs * 100 797 percentage_partial_objs = s->objects_partial * 100
805 / s->objects; 798 / s->objects;
806 799
807 if (percentage_partial_objs > 100) 800 if (percentage_partial_objs > 100)
@@ -823,8 +816,8 @@ void totals(void)
823 min_objects = s->objects; 816 min_objects = s->objects;
824 if (used < min_used) 817 if (used < min_used)
825 min_used = used; 818 min_used = used;
826 if (objects_in_partial_slabs < min_partobj) 819 if (s->objects_partial < min_partobj)
827 min_partobj = objects_in_partial_slabs; 820 min_partobj = s->objects_partial;
828 if (percentage_partial_slabs < min_ppart) 821 if (percentage_partial_slabs < min_ppart)
829 min_ppart = percentage_partial_slabs; 822 min_ppart = percentage_partial_slabs;
830 if (percentage_partial_objs < min_ppartobj) 823 if (percentage_partial_objs < min_ppartobj)
@@ -848,8 +841,8 @@ void totals(void)
848 max_objects = s->objects; 841 max_objects = s->objects;
849 if (used > max_used) 842 if (used > max_used)
850 max_used = used; 843 max_used = used;
851 if (objects_in_partial_slabs > max_partobj) 844 if (s->objects_partial > max_partobj)
852 max_partobj = objects_in_partial_slabs; 845 max_partobj = s->objects_partial;
853 if (percentage_partial_slabs > max_ppart) 846 if (percentage_partial_slabs > max_ppart)
854 max_ppart = percentage_partial_slabs; 847 max_ppart = percentage_partial_slabs;
855 if (percentage_partial_objs > max_ppartobj) 848 if (percentage_partial_objs > max_ppartobj)
@@ -864,7 +857,7 @@ void totals(void)
864 857
865 total_objects += s->objects; 858 total_objects += s->objects;
866 total_used += used; 859 total_used += used;
867 total_partobj += objects_in_partial_slabs; 860 total_partobj += s->objects_partial;
868 total_ppart += percentage_partial_slabs; 861 total_ppart += percentage_partial_slabs;
869 total_ppartobj += percentage_partial_objs; 862 total_ppartobj += percentage_partial_objs;
870 863
@@ -1160,6 +1153,8 @@ void read_slab_dir(void)
1160 slab->hwcache_align = get_obj("hwcache_align"); 1153 slab->hwcache_align = get_obj("hwcache_align");
1161 slab->object_size = get_obj("object_size"); 1154 slab->object_size = get_obj("object_size");
1162 slab->objects = get_obj("objects"); 1155 slab->objects = get_obj("objects");
1156 slab->objects_partial = get_obj("objects_partial");
1157 slab->objects_total = get_obj("objects_total");
1163 slab->objs_per_slab = get_obj("objs_per_slab"); 1158 slab->objs_per_slab = get_obj("objs_per_slab");
1164 slab->order = get_obj("order"); 1159 slab->order = get_obj("order");
1165 slab->partial = get_obj("partial"); 1160 slab->partial = get_obj("partial");