From 636b48efd8a441543b6eec5c5d4cb2d119adcb75 Mon Sep 17 00:00:00 2001 From: Takayuki Nagata Date: Wed, 27 Jul 2016 17:29:15 +0900 Subject: [PATCH] Revert "bprocps: fix order of operations for %use of slabinfo" 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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proc/slab.c b/proc/slab.c index 2d7f9678..444b79cc 100644 --- a/proc/slab.c +++ b/proc/slab.c @@ -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;