Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1764565AbZGABO2 (ORCPT ); Tue, 30 Jun 2009 21:14:28 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1761318AbZGAAfs (ORCPT ); Tue, 30 Jun 2009 20:35:48 -0400 Received: from kroah.org ([198.145.64.141]:60676 "EHLO coco.kroah.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753667AbZGAAfi (ORCPT ); Tue, 30 Jun 2009 20:35:38 -0400 X-Mailbox-Line: From gregkh@mini.kroah.org Tue Jun 30 17:24:41 2009 Message-Id: <20090701002441.356908481@mini.kroah.org> User-Agent: quilt/0.48-1 Date: Tue, 30 Jun 2009 17:24:22 -0700 From: Greg KH To: linux-kernel@vger.kernel.org, stable@kernel.org Cc: stable-review@kernel.org, torvalds@linux-foundation.org, akpm@linux-foundation.org, alan@lxorguk.ukuu.org.uk, Dimitri Sivanich , Christoph Lameter , Nick Piggin , Mel Gorman Subject: [patch 093/108] mm: fix handling of pagesets for downed cpus References: <20090701002249.937782934@mini.kroah.org> Content-Disposition: inline; filename=mm-fix-handling-of-pagesets-for-downed-cpus.patch In-Reply-To: <20090701002838.GA7100@kroah.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2244 Lines: 58 2.6.30-stable review patch. If anyone has any objections, please let us know. ------------------ From: Dimitri Sivanich commit 364df0ebfbbb1330bfc6ca159f4d6020efc15a12 upstream. After downing/upping a cpu, an attempt to set /proc/sys/vm/percpu_pagelist_fraction results in an oops in percpu_pagelist_fraction_sysctl_handler(). If a processor is downed then we need to set the pageset pointer back to the boot pageset. Updates of the high water marks should not access pagesets of unpopulated zones (those pointer go to the boot pagesets which would be no longer functional if their size would be increased beyond zero). Signed-off-by: Dimitri Sivanich Signed-off-by: Christoph Lameter Reviewed-by: KOSAKI Motohiro Cc: Nick Piggin Cc: Mel Gorman Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: Greg Kroah-Hartman --- mm/page_alloc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -2812,7 +2812,7 @@ bad: if (dzone == zone) break; kfree(zone_pcp(dzone, cpu)); - zone_pcp(dzone, cpu) = NULL; + zone_pcp(dzone, cpu) = &boot_pageset[cpu]; } return -ENOMEM; } @@ -2827,7 +2827,7 @@ static inline void free_zone_pagesets(in /* Free per_cpu_pageset if it is slab allocated */ if (pset != &boot_pageset[cpu]) kfree(pset); - zone_pcp(zone, cpu) = NULL; + zone_pcp(zone, cpu) = &boot_pageset[cpu]; } } @@ -4501,7 +4501,7 @@ int percpu_pagelist_fraction_sysctl_hand ret = proc_dointvec_minmax(table, write, file, buffer, length, ppos); if (!write || (ret == -EINVAL)) return ret; - for_each_zone(zone) { + for_each_populated_zone(zone) { for_each_online_cpu(cpu) { unsigned long high; high = zone->present_pages / percpu_pagelist_fraction; -- 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/