[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.10.1511112105200.9296@chino.kir.corp.google.com>
Date: Wed, 11 Nov 2015 21:07:04 -0800 (PST)
From: David Rientjes <rientjes@...gle.com>
To: Sergey Senozhatsky <sergey.senozhatsky.work@...il.com>
cc: Sergey Senozhatsky <sergey.senozhatsky@...il.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Christoph Lameter <cl@...ux.com>,
Pekka Enberg <penberg@...nel.org>,
Joonsoo Kim <iamjoonsoo.kim@....com>, linux-mm@...ck.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 3/3] tools/vm/slabinfo: update struct slabinfo members'
types
On Thu, 12 Nov 2015, Sergey Senozhatsky 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;
>
total_used and total_objects are unsigned long long. This has nothing to
do with object_size in the kernel. If you need to convert max_objsize to
be unsigned long long as well, that would be better.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists