From patchwork Thu Sep 24 08:18:44 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rusty Russell X-Patchwork-Id: 49748 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n8O8In9N022488 for ; Thu, 24 Sep 2009 08:18:50 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752144AbZIXISp (ORCPT ); Thu, 24 Sep 2009 04:18:45 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752180AbZIXISp (ORCPT ); Thu, 24 Sep 2009 04:18:45 -0400 Received: from ozlabs.org ([203.10.76.45]:56123 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752144AbZIXISn (ORCPT ); Thu, 24 Sep 2009 04:18:43 -0400 Received: from vivaldi.localnet (unknown [150.101.102.135]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPSA id F2492B7B70; Thu, 24 Sep 2009 18:18:46 +1000 (EST) From: Rusty Russell To: Linus Torvalds Subject: Re: [crash] BUG: unable to handle kernel NULL pointer dereference at (null), last sysfs file: /sys/devices/pci0000:00/0000:00:01.0/local_cpus Date: Thu, 24 Sep 2009 17:48:44 +0930 User-Agent: KMail/1.11.2 (Linux/2.6.28-15-generic; KDE/4.2.2; i686; ; ) Cc: Ingo Molnar , Jesse Barnes , "Greg Kroah-Hartman" , Yinghai Lu , Tejun Heo , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, Thomas Gleixner , "H. Peter Anvin" References: <20090915132105.2fdd1d45@jbarnes-g45> <20090918075952.GA29026@elte.hu> In-Reply-To: MIME-Version: 1.0 Content-Disposition: inline Message-Id: <200909241748.45629.rusty@rustcorp.com.au> Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org On Sat, 19 Sep 2009 01:08:02 am Linus Torvalds wrote: > [ Side note: looking closer, I think our headers are buggy, and I _know_ > they are confusing. The above inline declaration of cpumask_of_node() > seems to be then later overridden in by a > #define! > > And if I read that right, that will also override the debugging > versions that we declared if CONFIG_DEBUG_PER_CPU_MAPS is on. Ingo? > Rusty? Am I missing something? What a tangle. The CONFIG_DEBUG_PER_CPU_MAPS only overrides cpumask_of_node in the NUMA case (otherwise, it leaves it alone). And asm-generic/topology.h only defines cpumask_of_node in the !NUMA case. But there's still redundancy. Ingo... Subject: x86: remove redundant non-NUMA topology functions arch/x86/include/asm/topology.h declares inline fns cpu_to_node and cpumask_of_node for !NUMA, even though they are then declared as macros by asm-generic/topology.h, which is #included just below. The macros (which are the same) end up being used; these functions are just confusing. Signed-off-by: Rusty Russell --- arch/x86/include/asm/topology.h | 10 ---------- 1 file changed, 10 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-pci" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/arch/x86/include/asm/topology.h b/arch/x86/include/asm/topology.h --- a/arch/x86/include/asm/topology.h +++ b/arch/x86/include/asm/topology.h @@ -165,21 +165,11 @@ static inline int numa_node_id(void) return 0; } -static inline int cpu_to_node(int cpu) -{ - return 0; -} - static inline int early_cpu_to_node(int cpu) { return 0; } -static inline const struct cpumask *cpumask_of_node(int node) -{ - return cpu_online_mask; -} - static inline void setup_node_to_cpumask_map(void) { } #endif