From patchwork Thu Feb 5 09:34:09 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: KAMEZAWA Hiroyuki X-Patchwork-Id: 22091 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by ozlabs.org (Postfix) with ESMTP id C1006DDE1A for ; Thu, 5 Feb 2009 20:35:28 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756295AbZBEJf1 (ORCPT ); Thu, 5 Feb 2009 04:35:27 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1756310AbZBEJf1 (ORCPT ); Thu, 5 Feb 2009 04:35:27 -0500 Received: from fgwmail5.fujitsu.co.jp ([192.51.44.35]:44617 "EHLO fgwmail5.fujitsu.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755627AbZBEJfY (ORCPT ); Thu, 5 Feb 2009 04:35:24 -0500 Received: from m1.gw.fujitsu.co.jp ([10.0.50.71]) by fgwmail5.fujitsu.co.jp (Fujitsu Gateway) with ESMTP id n159ZMC3003083 (envelope-from kamezawa.hiroyu@jp.fujitsu.com); Thu, 5 Feb 2009 18:35:22 +0900 Received: from smail (m1 [127.0.0.1]) by outgoing.m1.gw.fujitsu.co.jp (Postfix) with ESMTP id 05C8345DD76; Thu, 5 Feb 2009 18:35:22 +0900 (JST) Received: from s1.gw.fujitsu.co.jp (s1.gw.fujitsu.co.jp [10.0.50.91]) by m1.gw.fujitsu.co.jp (Postfix) with ESMTP id CA2EC45DD75; Thu, 5 Feb 2009 18:35:21 +0900 (JST) Received: from s1.gw.fujitsu.co.jp (localhost.localdomain [127.0.0.1]) by s1.gw.fujitsu.co.jp (Postfix) with ESMTP id A67831DB8040; Thu, 5 Feb 2009 18:35:21 +0900 (JST) Received: from m107.s.css.fujitsu.com (m107.s.css.fujitsu.com [10.249.87.107]) by s1.gw.fujitsu.co.jp (Postfix) with ESMTP id 5EACE1DB803C; Thu, 5 Feb 2009 18:35:21 +0900 (JST) Received: from m107.css.fujitsu.com (m107 [127.0.0.1]) by m107.s.css.fujitsu.com (Postfix) with ESMTP id DFC772C00C7; Thu, 5 Feb 2009 18:35:20 +0900 (JST) Received: from WIN-WAU6SZB64RR (unknown [10.124.100.143]) by m107.s.css.fujitsu.com (Postfix) with SMTP id 51FFB2C00C5; Thu, 5 Feb 2009 18:35:20 +0900 (JST) Date: Thu, 5 Feb 2009 18:34:09 +0900 From: KAMEZAWA Hiroyuki To: David Miller Cc: mel@csn.ul.ie, heiko.carstens@de.ibm.com, akpm@linux-foundation.org, linux-kernel@vger.kernel.org, sparclinux@vger.kernel.org Subject: Re: HOLES_IN_ZONE... Message-Id: <20090205183409.1a12c23b.kamezawa.hiroyu@jp.fujitsu.com> In-Reply-To: <20090205.012123.141238531.davem@davemloft.net> References: <20090204.222651.26527737.davem@davemloft.net> <20090205180617.8ee3dfb5.kamezawa.hiroyu@jp.fujitsu.com> <20090205.012123.141238531.davem@davemloft.net> Organization: FUJITSU Co. LTD. X-Mailer: Sylpheed 2.5.0 (GTK+ 2.10.14; i686-pc-mingw32) Mime-Version: 1.0 Sender: sparclinux-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: sparclinux@vger.kernel.org On Thu, 05 Feb 2009 01:21:23 -0800 (PST) David Miller wrote: > From: KAMEZAWA Hiroyuki > Date: Thu, 5 Feb 2009 18:06:17 +0900 > > > @@ -2632,7 +2633,8 @@ void __meminit memmap_init_zone(unsigned > > if (context == MEMMAP_EARLY) { > > if (!early_pfn_valid(pfn)) > > continue; > > - if (!early_pfn_in_nid(pfn, nid)) > > + tmp = early_pfn_in_nid(pfn, nid); > > + if (tmp > -1 && tmp != nid) > > early_pfn_in_nid() returns true or false, not the found nid > > I think you meant to change this to call early_pfn_to_nid() > sorry.. > I'll make that correction and test your patch. > > BTW, if you make that conversion there is no need for > early_pfn_in_nid() since there will be no other users. > Thanks, maybe the patch will be like this. -Kame == If a pfn is not in early_node_map[], memmap for it is not initialized. By this, PG_reserved is not set and the invalid memmap may sneak into buddy allocator. To avoid that, initialize it with give nid if no early_node_map[] for pfn exists. PG_reserved will make this page unused. Signed-off-by: KAMEZAWA Hiroyuki Acked-by: Mel Gorman --- include/linux/mmzone.h | 6 ------ mm/page_alloc.c | 7 +++++-- 2 files changed, 5 insertions(+), 8 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe sparclinux" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Index: mmotm-2.6.29-Feb03/mm/page_alloc.c =================================================================== --- mmotm-2.6.29-Feb03.orig/mm/page_alloc.c +++ mmotm-2.6.29-Feb03/mm/page_alloc.c @@ -2618,6 +2618,7 @@ void __meminit memmap_init_zone(unsigned unsigned long end_pfn = start_pfn + size; unsigned long pfn; struct zone *z; + int tmp; if (highest_memmap_pfn < end_pfn - 1) highest_memmap_pfn = end_pfn - 1; @@ -2632,7 +2633,8 @@ void __meminit memmap_init_zone(unsigned if (context == MEMMAP_EARLY) { if (!early_pfn_valid(pfn)) continue; - if (!early_pfn_in_nid(pfn, nid)) + tmp = early_pfn_to_nid(pfn); + if (tmp > -1 && tmp != nid) continue; } page = pfn_to_page(pfn); @@ -2999,8 +3001,9 @@ int __meminit early_pfn_to_nid(unsigned return early_node_map[i].nid; } - return 0; + return -1; } + #endif /* CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID */ /* Basic iterator support to walk early_node_map[] */ Index: mmotm-2.6.29-Feb03/include/linux/mmzone.h =================================================================== --- mmotm-2.6.29-Feb03.orig/include/linux/mmzone.h +++ mmotm-2.6.29-Feb03/include/linux/mmzone.h @@ -1070,12 +1070,6 @@ void sparse_init(void); #define sparse_index_init(_sec, _nid) do {} while (0) #endif /* CONFIG_SPARSEMEM */ -#ifdef CONFIG_NODES_SPAN_OTHER_NODES -#define early_pfn_in_nid(pfn, nid) (early_pfn_to_nid(pfn) == (nid)) -#else -#define early_pfn_in_nid(pfn, nid) (1) -#endif - #ifndef early_pfn_valid #define early_pfn_valid(pfn) (1) #endif