From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <44997D9E.8040304@google.com> Date: Wed, 21 Jun 2006 10:10:54 -0700 From: Martin Bligh MIME-Version: 1.0 Subject: Re: [PATCH 00/14] Zoned VM counters V5 References: <20060621154419.18741.76233.sendpatchset@schroedinger.engr.sgi.com> <44997596.7050903@google.com> In-Reply-To: Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org Return-Path: To: Christoph Lameter Cc: akpm@osdl.org, linux-mm List-ID: Christoph Lameter wrote: > On Wed, 21 Jun 2006, Martin J. Bligh wrote: > > >>Having the per-cpu counters with a global overflow seems like a really >>nice way to do counters to me - is it worth doing this as a more >>generalized counter type so that others could use it? > > > Yes later patches also use the counters for other things. Please check out > the patch that uses these for numa counters etc. OK, but looked like the original implementation was sort of tied to zones / the VM, at least in terminology, and code placement. I'll look at it again ... >>OTOH, I'm unsure why we're only using 8 bits in struct zone, which isn't >>size critical. Is it just so you can pack vast numbers of different stats into >>a single cacheline? > > > I would like to add some stats in the future. 8 bits is sufficient if the > threshold is less than 64 (currently its 32). If we ever get higher then > we can simply go to a bigger base size. > > However, the space used by that array is > > ** > > There are systems that have around 1k nodes and 4k processors. Lets say > we have 16 counters then we get to > > 1k*4k*16 = 64Mbyte just for the counters. > > This doubles for a short and quadruples for an int. > > Also smaller counters help keep the pcp structure in one cacheline and > reduces the cache footprint. Sure, but for a normal sized system, the smaller the per-cpu portion, the more atomic ops you'll end up doing, surely? M. -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org