From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755872Ab0CIUXm (ORCPT ); Tue, 9 Mar 2010 15:23:42 -0500 Received: from smtp1.linux-foundation.org ([140.211.169.13]:42369 "EHLO smtp1.linux-foundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754383Ab0CIUXj (ORCPT ); Tue, 9 Mar 2010 15:23:39 -0500 Date: Tue, 9 Mar 2010 12:22:53 -0800 From: Andrew Morton To: Thomas Gleixner Cc: LKML , linux-mm@kvack.org, Pekka Enberg , Christoph Lameter Subject: Re: mm: Do not iterate over NR_CPUS in __zone_pcp_update() Message-Id: <20100309122253.3f3d4a53.akpm@linux-foundation.org> In-Reply-To: References: 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 On Mon, 8 Mar 2010 10:21:04 +0100 (CET) Thomas Gleixner wrote: > __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(-) > > 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; > I'm having trouble working out whether we want to backport this into 2.6.33.x or earlier. Help?