Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750998AbbKLFHJ (ORCPT ); Thu, 12 Nov 2015 00:07:09 -0500 Received: from mail-pa0-f47.google.com ([209.85.220.47]:33466 "EHLO mail-pa0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750797AbbKLFHH (ORCPT ); Thu, 12 Nov 2015 00:07:07 -0500 Date: Wed, 11 Nov 2015 21:07:04 -0800 (PST) From: David Rientjes X-X-Sender: rientjes@chino.kir.corp.google.com To: Sergey Senozhatsky cc: Sergey Senozhatsky , Andrew Morton , Christoph Lameter , Pekka Enberg , Joonsoo Kim , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 3/3] tools/vm/slabinfo: update struct slabinfo members' types In-Reply-To: <20151112011347.GC1651@swordfish> Message-ID: References: <1447162326-30626-1-git-send-email-sergey.senozhatsky@gmail.com> <1447162326-30626-4-git-send-email-sergey.senozhatsky@gmail.com> <20151112011347.GC1651@swordfish> User-Agent: Alpine 2.10 (DEB 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1129 Lines: 29 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@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/