Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759194AbZKFELZ (ORCPT ); Thu, 5 Nov 2009 23:11:25 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755712AbZKFELY (ORCPT ); Thu, 5 Nov 2009 23:11:24 -0500 Received: from fgwmail7.fujitsu.co.jp ([192.51.44.37]:37374 "EHLO fgwmail7.fujitsu.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750741AbZKFELX (ORCPT ); Thu, 5 Nov 2009 23:11:23 -0500 X-SecurityPolicyCheck-FJ: OK by FujitsuOutboundMailChecker v1.3.1 Date: Fri, 6 Nov 2009 13:08:53 +0900 From: KAMEZAWA Hiroyuki To: Christoph Lameter Cc: Dave Jones , "hugh.dickins@tiscali.co.uk" , linux-mm@kvack.org, linux-kernel@vger.kernel.org, akpm@linux-foundation.org, Tejun Heo Subject: Re: [MM] Make mm counters per cpu instead of atomic V2 Message-Id: <20091106130853.f9e29574.kamezawa.hiroyu@jp.fujitsu.com> In-Reply-To: References: <20091104234923.GA25306@redhat.com> Organization: FUJITSU Co. LTD. X-Mailer: Sylpheed 2.5.0 (GTK+ 2.10.14; i686-pc-mingw32) 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: 608 Lines: 22 On Thu, 5 Nov 2009 10:36:06 -0500 (EST) Christoph Lameter wrote: > +static inline unsigned long get_mm_rss(struct mm_struct *mm) > +{ > + int cpu; > + unsigned long r = 0; > + > + for_each_possible_cpu(cpu) { > + struct mm_counter *c = per_cpu_ptr(mm->rss, cpu); > + > + r = c->file + c->anon; r += c->file + c->anon; Thanks, -Kame -- 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/