]> granicus.if.org Git - procps-ng/commit
bprocps: fix order of operations for %use of slabinfo
authorTakayuki Nagata <tnagata@redhat.com>
Mon, 25 Apr 2016 09:30:36 +0000 (05:30 -0400)
committerCraig Small <csmall@enc.com.au>
Mon, 25 Apr 2016 10:20:08 +0000 (20:20 +1000)
commit99d71ad5810b8fbfab5c4c6be97f3e86953b6157
tree1add4b24e5d394ed6d113f206a64555cfbd8289b
parenta0f0f4fc697c89df3c7d2240d5fe1ae3f8669298
bprocps: fix order of operations for %use of slabinfo

In some environments, 100 * nr_active_objs is calculated at first,
and lower 32bit of the result is divided by nr_objs.
If 100 * nr_active_objs > 42949672, %use will be incorrect.

Signed-off-by: Takayuki Nagata <tnagata@redhat.com>
proc/slab.c