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.
Reported by Takayuki Nagata <tnagata@redhat.com> and adopted
his patch for new library (see reference)
References:
commit
99d71ad5810b8fbfab5c4c6be97f3e86953b6157
http://www.freelists.org/post/procps/PATCH-bprocps-fix-order-of-operations-for-use-of-slabinfo
* page_size;
if (node->nr_objs) {
- node->use = (unsigned int)100 * node->nr_active_objs / node->nr_objs;
+ node->use = (unsigned int)100 * (node->nr_active_objs / node->nr_objs);
stats->nr_active_caches++;
} else
node->use = 0;