lkml.org 
[lkml]   [2015]   [Nov]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 3/3] tools/vm/slabinfo: update struct slabinfo members' types
On (11/11/15 12:55), David Rientjes wrote:
[..]
> > /* Object size */
> > - unsigned long long min_objsize = max, max_objsize = 0, avg_objsize;
> > + unsigned int min_objsize = UINT_MAX, max_objsize = 0, avg_objsize;
> >
> > /* Number of partial slabs in a slabcache */
> > unsigned long long min_partial = max, max_partial = 0,
>
> avg_objsize should not be unsigned int.

Hm. the assumption is that `avg_objsize' cannot be larger
than `max_objsize', which is
`int object_size;' in `struct kmem_cache' from slab_def.h
and
`unsigned int object_size;' in `struct kmem_cache' from slab.h.


avg_objsize = total_used / total_objects;


-ss


\
 
 \ /
  Last update: 2015-11-12 02:21    [W:0.068 / U:0.044 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site