Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758829AbZKEUEN (ORCPT ); Thu, 5 Nov 2009 15:04:13 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1758763AbZKEUEN (ORCPT ); Thu, 5 Nov 2009 15:04:13 -0500 Received: from smtp4.ultrahosting.com ([74.213.175.253]:48649 "EHLO smtp.ultrahosting.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1758514AbZKEUEN (ORCPT ); Thu, 5 Nov 2009 15:04:13 -0500 Date: Thu, 5 Nov 2009 10:20:18 -0500 (EST) From: Christoph Lameter X-X-Sender: cl@V090114053VZO-1 To: KAMEZAWA Hiroyuki cc: "linux-kernel@vger.kernel.org" , "linux-mm@kvack.org" , "hugh.dickins@tiscali.co.uk" , akpm@linux-foundation.org, "kosaki.motohiro@jp.fujitsu.com" Subject: Re: [RFC][PATCH] lib: generic percpu counter array In-Reply-To: <20091105141653.132d4977.kamezawa.hiroyu@jp.fujitsu.com> Message-ID: References: <20091104152426.eacc894f.kamezawa.hiroyu@jp.fujitsu.com> <20091105090659.9a5d17b1.kamezawa.hiroyu@jp.fujitsu.com> <20091105141653.132d4977.kamezawa.hiroyu@jp.fujitsu.com> User-Agent: Alpine 1.10 (DEB 962 2008-03-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: 1068 Lines: 23 On Thu, 5 Nov 2009, KAMEZAWA Hiroyuki wrote: > Anothter major percpu coutner is vm_stat[]. This patch implements > vm_stat[] style counter array in lib/percpu_counter.c > This is designed for introducing vm_stat[] style counter to memcg, > but maybe useful for other people. By using this, counter array > using percpu can be implemented easily in compact structure. Note that vm_stat support was written that way because we have extreme space constraints due to the need to keep statistics per zone and per cpu and avoid cache line pressure that would result through the use of big integer arrays per zone and per cpu. For a large number of zones and cpus this is desastrous. If you only need to keep statistics per cpu for an entity then the vmstat approach is overkill. A per cpu allocation of a counter is enough. -- 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/