Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759572AbcJYVbi (ORCPT ); Tue, 25 Oct 2016 17:31:38 -0400 Received: from mail-pf0-f196.google.com ([209.85.192.196]:34730 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755266AbcJYVbL (ORCPT ); Tue, 25 Oct 2016 17:31:11 -0400 From: David Daney To: linux-kernel@vger.kernel.org, Rob Herring , Frank Rowand , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Will Deacon , Catalin Marinas Cc: Robert Richter , Hanjun Guo , Ganapatrao Kulkarni , Gilbert Netzer , David Daney Subject: [PATCH 2/2] arm64, numa: Force of_node_to_nid to return NUMA_NO_NODE when numa=off. Date: Tue, 25 Oct 2016 14:31:01 -0700 Message-Id: <1477431061-7258-3-git-send-email-ddaney.cavm@gmail.com> X-Mailer: git-send-email 1.7.11.7 In-Reply-To: <1477431061-7258-1-git-send-email-ddaney.cavm@gmail.com> References: <1477431061-7258-1-git-send-email-ddaney.cavm@gmail.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1875 Lines: 59 From: David Daney When "numa=off" is passed on the command line, of_node_to_nid() still returns the node number (which can be greater than zero). However, in this case all the memory is associated with the dummy node zero. This causes OOPS in kernel/irq/irqdomain.c: domain = kzalloc_node(sizeof(*domain) + (sizeof(unsigned int) * size), GFP_KERNEL, of_node_to_nid(of_node)); ... which in my case then caused the kernel to OOPS for the IRQ controller on node 1: [ 0.000000] [] __alloc_pages_nodemask+0xa4/0xe68 [ 0.000000] [] new_slab+0xd0/0x57c [ 0.000000] [] ___slab_alloc+0x2e4/0x514 [ 0.000000] [] __slab_alloc+0x48/0x58 [ 0.000000] [] __kmalloc_node+0xd0/0x2e0 [ 0.000000] [] __irq_domain_add+0x7c/0x164 [ 0.000000] [] its_probe+0x784/0x81c [ 0.000000] [] its_init+0x48/0x1b0 Fix by forcing of_node_to_nid() to return NUMA_NO_NODE when numa=off. The kmalloc_node() family is perfectly happy when the node is specified as NUMA_NO_NODE. Reported-by: Gilbert Netzer Signed-off-by: David Daney --- arch/arm64/mm/numa.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/arch/arm64/mm/numa.c b/arch/arm64/mm/numa.c index 778a985..6d34ebb 100644 --- a/arch/arm64/mm/numa.c +++ b/arch/arm64/mm/numa.c @@ -41,8 +41,10 @@ static __init int numa_parse_early_param(char *opt) { if (!opt) return -EINVAL; - if (!strncmp(opt, "off", 3)) + if (!strncmp(opt, "off", 3)) { + __of_force_no_numa(); numa_off = true; + } return 0; } @@ -432,6 +434,7 @@ static int __init dummy_numa_init(void) return ret; } + __of_force_no_numa(); numa_off = true; return 0; } -- 1.8.3.1