From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751941Ab0CIGeX (ORCPT ); Tue, 9 Mar 2010 01:34:23 -0500 Received: from fgwmail5.fujitsu.co.jp ([192.51.44.35]:52373 "EHLO fgwmail5.fujitsu.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751494Ab0CIGeU (ORCPT ); Tue, 9 Mar 2010 01:34:20 -0500 X-SecurityPolicyCheck-FJ: OK by FujitsuOutboundMailChecker v1.3.1 From: KOSAKI Motohiro To: Thomas Gleixner Subject: Re: mm: Do not iterate over NR_CPUS in __zone_pcp_update() Cc: kosaki.motohiro@jp.fujitsu.com, LKML , linux-mm@kvack.org, Pekka Enberg , Christoph Lameter In-Reply-To: References: Message-Id: <20100309153342.7CEE.A69D9226@jp.fujitsu.com> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Mailer: Becky! ver. 2.50.07 [ja] Date: Tue, 9 Mar 2010 15:34:17 +0900 (JST) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > __zone_pcp_update() iterates over NR_CPUS instead of limiting the > access to the possible cpus. This might result in access to > uninitialized areas as the per cpu allocator only populates the per > cpu memory for possible cpus. > > Signed-off-by: Thomas Gleixner > --- > mm/page_alloc.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Looks good. Reviewed-by: KOSAKI Motohiro > > Index: linux-2.6/mm/page_alloc.c > =================================================================== > --- linux-2.6.orig/mm/page_alloc.c > +++ linux-2.6/mm/page_alloc.c > @@ -3224,7 +3224,7 @@ static int __zone_pcp_update(void *data) > int cpu; > unsigned long batch = zone_batchsize(zone), flags; > > - for (cpu = 0; cpu < NR_CPUS; cpu++) { > + for_each_possible_cpu(cpu) { > struct per_cpu_pageset *pset; > struct per_cpu_pages *pcp; > > > -- > 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