Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932210AbYASPYX (ORCPT ); Sat, 19 Jan 2008 10:24:23 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755126AbYASPYQ (ORCPT ); Sat, 19 Jan 2008 10:24:16 -0500 Received: from mx3.mail.elte.hu ([157.181.1.138]:37185 "EHLO mx3.mail.elte.hu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759733AbYASPYP (ORCPT ); Sat, 19 Jan 2008 10:24:15 -0500 Date: Sat, 19 Jan 2008 16:24:00 +0100 From: Ingo Molnar To: travis@sgi.com Cc: Andrew Morton , Andi Kleen , Christoph Lameter , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 4/5] x86: Add config variables for SMP_MAX Message-ID: <20080119152357.GA11706@elte.hu> References: <20080118183011.354965000@sgi.com> <20080118183011.917801000@sgi.com> <20080119145243.GA27974@elte.hu> <20080119151522.GA7774@elte.hu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080119151522.GA7774@elte.hu> User-Agent: Mutt/1.5.17 (2007-11-01) X-ELTE-VirusStatus: clean X-ELTE-SpamScore: -1.5 X-ELTE-SpamLevel: X-ELTE-SpamCheck: no X-ELTE-SpamVersion: ELTE 2.0 X-ELTE-SpamCheck-Details: score=-1.5 required=5.9 tests=BAYES_00 autolearn=no SpamAssassin version=3.2.3 -1.5 BAYES_00 BODY: Bayesian spam probability is 0 to 1% [score: 0.0000] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1670 Lines: 49 * Ingo Molnar wrote: > and then it crashes with: > > [ 0.000000] Bootmem setup node 0 0000000000000000-000000003fff0000 > [ 0.000000] KERN_NOTICE cpu_to_node(0): usage too early! > PANIC: early exception 06 rip 10:ffffffff81f77f30 error 0 cr2 f06f53 > [ 0.000000] Pid: 0, comm: swapper Not tainted 2.6.24-rc8 #422 > [ 0.000000] > [ 0.000000] Call Trace: > [ 0.000000] [] ? setup_node_bootmem+0x1a0/0x1b8 > [ 0.000000] [] ? acpi_scan_nodes+0x204/0x255 > [ 0.000000] [] ? acpi_scan_nodes+0x204/0x255 > [ 0.000000] [] ? numa_initmem_init+0x343/0x471 > > moral: PLEASE do not use BUG() on in early init code, unless > absolutely necessary. the right fix is below. Ingo --- include/asm-x86/topology.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) Index: linux/include/asm-x86/topology.h =================================================================== --- linux.orig/include/asm-x86/topology.h +++ linux/include/asm-x86/topology.h @@ -70,10 +70,10 @@ static inline int cpu_to_node(int cpu) if(x86_cpu_to_node_map_early_ptr) { printk("KERN_NOTICE cpu_to_node(%d): usage too early!\n", (int)cpu); - BUG(); + dump_stack(); } #endif - if(per_cpu_offset(cpu)) + if (per_cpu_offset(cpu)) return per_cpu(x86_cpu_to_node_map, cpu); else return NUMA_NO_NODE; -- 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/