From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from e7.ny.us.ibm.com (e7.ny.us.ibm.com [32.97.182.137]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 0A45A2C041D for ; Thu, 20 Feb 2014 10:17:24 +1100 (EST) Received: from /spool/local by e7.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 19 Feb 2014 18:17:22 -0500 Received: from b01cxnp22034.gho.pok.ibm.com (b01cxnp22034.gho.pok.ibm.com [9.57.198.24]) by d01dlp01.pok.ibm.com (Postfix) with ESMTP id 9B06738C8045 for ; Wed, 19 Feb 2014 18:17:20 -0500 (EST) Received: from d01av04.pok.ibm.com (d01av04.pok.ibm.com [9.56.224.64]) by b01cxnp22034.gho.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id s1JNHKdg48693422 for ; Wed, 19 Feb 2014 23:17:20 GMT Received: from d01av04.pok.ibm.com (localhost [127.0.0.1]) by d01av04.pok.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id s1JNHIdn020942 for ; Wed, 19 Feb 2014 18:17:20 -0500 Date: Wed, 19 Feb 2014 15:17:14 -0800 From: Nishanth Aravamudan To: Michal Hocko , Mel Gorman , linux-mm@kvack.org, Christoph Lameter , David Rientjes , Joonsoo Kim , Ben Herrenschmidt , Anton Blanchard , linuxppc-dev@lists.ozlabs.org Subject: [PATCH 1/3] mm: return NUMA_NO_NODE in local_memory_node if zonelists are not setup Message-ID: <20140219231714.GB413@linux.vnet.ibm.com> References: <20140219231641.GA413@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii In-Reply-To: <20140219231641.GA413@linux.vnet.ibm.com> List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , We can call local_memory_node() before the zonelists are setup. In that case, first_zones_zonelist() will not set zone and the reference to zone->node will Oops. Catch this case, and, since we presumably running very early, just return that any node will do. Signed-off-by: Nishanth Aravamudan Cc: Andrew Morton Cc: Michal Hocko Cc: Mel Gorman Cc: linux-mm@kvack.org Cc: linux-kernel@vger.kernel.org Cc: Christoph Lameter Cc: David Rientjes Cc: Joonsoo Kim Cc: Ben Herrenschmidt Cc: Anton Blanchard diff --git a/mm/page_alloc.c b/mm/page_alloc.c index e3758a0..5de4337 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -3650,6 +3650,8 @@ int local_memory_node(int node) gfp_zone(GFP_KERNEL), NULL, &zone); + if (!zone) + return NUMA_NO_NODE; return zone->node; } #endif