Revert "bprocps: fix order of operations for %use of slabinfo"
authorTakayuki Nagata <tnagata@redhat.com>
Wed, 27 Jul 2016 08:29:15 +0000 (17:29 +0900)
committerTakayuki Nagata <tnagata@redhat.com>
Wed, 12 Oct 2016 07:58:56 +0000 (16:58 +0900)
This reverts commit 99d71ad5810b8fbfab5c4c6be97f3e86953b6157.

When nr_active_objs / nr_objs is calculated, the result will be 1
or 0 since the variables are integer. So the commit is wrong.

proc/slab.c

index 2d7f96786a69e108b151e322838d881722ce4eb4..444b79cc4e8ff6d9dc7f97aa2813d0479782bf50 100644 (file)
@@ -179,7 +179,7 @@ static int parse_slabinfo20(struct slab_info **list, struct slab_stat *stats,
                curr->cache_size = (unsigned long)curr->nr_slabs * curr->pages_per_slab * page_size;
 
                if (curr->nr_objs) {
-                       curr->use = 100 * (curr->nr_active_objs / curr->nr_objs);
+                       curr->use = 100 * curr->nr_active_objs / curr->nr_objs;
                        stats->nr_active_caches++;
                } else
                        curr->use = 0;