From patchwork Tue Dec 9 18:21:33 2008 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Hansen X-Patchwork-Id: 13020 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from ozlabs.org (localhost [127.0.0.1]) by ozlabs.org (Postfix) with ESMTP id 6B6FD474D2 for ; Wed, 10 Dec 2008 05:39:42 +1100 (EST) X-Original-To: linuxppc-dev@ozlabs.org Delivered-To: linuxppc-dev@ozlabs.org Received: from e33.co.us.ibm.com (e33.co.us.ibm.com [32.97.110.151]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "e32.co.us.ibm.com", Issuer "Equifax" (verified OK)) by ozlabs.org (Postfix) with ESMTPS id 748F5DDF76 for ; Wed, 10 Dec 2008 05:21:55 +1100 (EST) Received: from d03relay04.boulder.ibm.com (d03relay04.boulder.ibm.com [9.17.195.106]) by e33.co.us.ibm.com (8.13.1/8.13.1) with ESMTP id mB9ILAJ5017900 for ; Tue, 9 Dec 2008 11:21:10 -0700 Received: from d03av03.boulder.ibm.com (d03av03.boulder.ibm.com [9.17.195.169]) by d03relay04.boulder.ibm.com (8.13.8/8.13.8/NCO v9.1) with ESMTP id mB9ILbT5177174 for ; Tue, 9 Dec 2008 11:21:37 -0700 Received: from d03av03.boulder.ibm.com (loopback [127.0.0.1]) by d03av03.boulder.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id mB9ILaRd004951 for ; Tue, 9 Dec 2008 11:21:36 -0700 Received: from kernel (kernel.beaverton.ibm.com [9.47.67.96]) by d03av03.boulder.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id mB9ILZ91004913; Tue, 9 Dec 2008 11:21:36 -0700 Received: from localhost ([127.0.0.1] helo=localhost.localdomain) by kernel with esmtp (Exim 3.36 #1 (Debian)) id 1LA7DD-0002DU-00; Tue, 09 Dec 2008 10:21:35 -0800 Subject: [PATCH 3/8] cleanup careful_allocation(): bootmem already panics To: paulus@samba.org From: Dave Hansen Date: Tue, 09 Dec 2008 10:21:33 -0800 References: <20081209182130.DB2150A2@kernel> In-Reply-To: <20081209182130.DB2150A2@kernel> Message-Id: <20081209182133.B06DD407@kernel> Cc: Jon Tollefson , Mel Gorman , Dave Hansen , linuxppc-dev@ozlabs.org, "Serge E. Hallyn" X-BeenThere: linuxppc-dev@ozlabs.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@ozlabs.org Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@ozlabs.org If we fail a bootmem allocation, the bootmem code itself panics. No need to redo it here. Also change the wording of the other panic. We don't strictly have to allocate memory on the specified node. It is just a hint and that node may not even *have* any memory on it. In that case we can and do fall back to other nodes. Signed-off-by: Dave Hansen --- linux-2.6.git-dave/arch/powerpc/mm/numa.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff -puN arch/powerpc/mm/numa.c~cleanup-careful_allocation arch/powerpc/mm/numa.c --- linux-2.6.git/arch/powerpc/mm/numa.c~cleanup-careful_allocation 2008-12-09 10:16:05.000000000 -0800 +++ linux-2.6.git-dave/arch/powerpc/mm/numa.c 2008-12-09 10:16:05.000000000 -0800 @@ -836,7 +836,7 @@ static void __init *careful_allocation(i ret = __lmb_alloc_base(size, align, lmb_end_of_DRAM()); if (!ret) - panic("numa.c: cannot allocate %lu bytes on node %d", + panic("numa.c: cannot allocate %lu bytes for node %d", size, nid); /* @@ -856,10 +856,6 @@ static void __init *careful_allocation(i ret = (unsigned long)__alloc_bootmem_node(NODE_DATA(new_nid), size, align, 0); - if (!ret) - panic("numa.c: cannot allocate %lu bytes on node %d", - size, new_nid); - ret = __pa(ret); dbg("alloc_bootmem %lx %lx\n", ret, size);