Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758591AbZKJWpQ (ORCPT ); Tue, 10 Nov 2009 17:45:16 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1758377AbZKJWpO (ORCPT ); Tue, 10 Nov 2009 17:45:14 -0500 Received: from smtp1.linux-foundation.org ([140.211.169.13]:46270 "EHLO smtp1.linux-foundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758405AbZKJWpM (ORCPT ); Tue, 10 Nov 2009 17:45:12 -0500 Date: Tue, 10 Nov 2009 14:44:38 -0800 From: Andrew Morton To: KAMEZAWA Hiroyuki Cc: Christoph Lameter , Dave Jones , "hugh.dickins@tiscali.co.uk" , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Tejun Heo Subject: Re: [MM] Make mm counters per cpu instead of atomic V2 Message-Id: <20091110144438.dbab0ba8.akpm@linux-foundation.org> In-Reply-To: <20091106101106.8115e0f1.kamezawa.hiroyu@jp.fujitsu.com> References: <20091104234923.GA25306@redhat.com> <20091106101106.8115e0f1.kamezawa.hiroyu@jp.fujitsu.com> X-Mailer: Sylpheed 2.4.8 (GTK+ 2.12.9; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1875 Lines: 47 On Fri, 6 Nov 2009 10:11:06 +0900 KAMEZAWA Hiroyuki wrote: > On Thu, 5 Nov 2009 10:36:06 -0500 (EST) > Christoph Lameter wrote: > > > From: Christoph Lameter > > Subject: Make mm counters per cpu V2 > > > > Changing the mm counters to per cpu counters is possible after the introduction > > of the generic per cpu operations (currently in percpu and -next). > > > > With that the contention on the counters in mm_struct can be avoided. The > > USE_SPLIT_PTLOCKS case distinction can go away. Larger SMP systems do not > > need to perform atomic updates to mm counters anymore. Various code paths > > can be simplified since per cpu counter updates are fast and batching > > of counter updates is no longer needed. > > > > One price to pay for these improvements is the need to scan over all percpu > > counters when the actual count values are needed. > > > > V1->V2 > > - Remove useless and buggy per cpu counter initialization. > > alloc_percpu already zeros the values. > > > > Signed-off-by: Christoph Lameter > > > Thanks. My small concern is read-side. Me too. For example, with 1000 possible CPUs (possible, not present and not online), and 1000 processes, ps(1) will have to wallow through a million cachelines in task_statm(). And then we have get_mm_rs(), which now will hit 1000 cachelines. And get_mm_rs() is called (via account_user_time()->acct_update_integrals()) from the clock tick. Adding a thousand cache misses to the timer interrupt is the sort of thing which makes people unhappy? -- 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/