From patchwork Tue Oct 25 21:31:01 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Daney X-Patchwork-Id: 9395567 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 2CE7260235 for ; Tue, 25 Oct 2016 21:33:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 08B4B29764 for ; Tue, 25 Oct 2016 21:33:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F1A9529775; Tue, 25 Oct 2016 21:33:56 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id CCCCA29764 for ; Tue, 25 Oct 2016 21:33:53 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bz9Kc-0003R3-LI; Tue, 25 Oct 2016 21:32:26 +0000 Received: from mail-pf0-x243.google.com ([2607:f8b0:400e:c00::243]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bz9Jj-000330-UF for linux-arm-kernel@lists.infradead.org; Tue, 25 Oct 2016 21:31:36 +0000 Received: by mail-pf0-x243.google.com with SMTP id i85so20636864pfa.0 for ; Tue, 25 Oct 2016 14:31:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=0QZlhJg31xtYbnwMgOiJq4pJrdV0s+lbbn7kC/dCzak=; b=GdzGwSCDS6VS7WDcEbWDvJ37cLm2Ap/MZvHunpPYm2unW1Ge1AW4ZS7N7eMio/KzpQ v+0C1j+asbVLUYWXylj8dxlDxCxq6w0cXbBPYcFc96GdS9sWgilU4n1ytTYOYz7ZVfyZ DgCJT37RDb0ux/RuPfjxX2p2anQrd9cwt0jSXIjEO3Y5CdqbMLYCuXa61KJjv1K4MOxu sfGy+hw0lLBD9gWPDjdO73lwNv7cBepyQPRPEvkAizcxvkLEggSr31NLFW2ZHTZG1Orv MV4Ey24TLbBHhMXGDM85V+f2ZPcV0xW47tw/Bb0U4VtNcgn1Hnlm0XmjAOAQK0Oixgb9 ELzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=0QZlhJg31xtYbnwMgOiJq4pJrdV0s+lbbn7kC/dCzak=; b=Nx7s/77qQMLVf8KffQMzoLSD9pOD5k1wzinFM4Fnqu+xKVhdx8hzqBViDMH5KPC+rd HYcCxIrpcQkLCaBTUyoWa0kukM7wK/XkUQRZivLo9plnZtPY8lswPbFJY7wpaNScqijj ixUvWaOIKiMCZare9T+/rVNOPuKYzA7V3hadSzvsmVh2k+NTFo9hAu6fMUnKSIPjvPGY BYhxBPB05rNWxJfXSBprHKhDyE03lS+5Xt4OFhokN7q9sntQ/qksngu1umadB3VOJEGv FW336XDb3GJ+F1TTJOaerA/DMywKQV7SAEuEmh9kaRuKR03/j4ld7UzhrRmoDM60wF20 C0yA== X-Gm-Message-State: ABUngvfTIaEKhkoCrVly20qikwTQzLvFJxa3oBVWTFxXK0pYGHrc47mO58Ju72WpmSxnVQ== X-Received: by 10.99.120.203 with SMTP id t194mr36212751pgc.17.1477431070979; Tue, 25 Oct 2016 14:31:10 -0700 (PDT) Received: from dl.caveonetworks.com (50-233-148-156-static.hfc.comcastbusiness.net. [50.233.148.156]) by smtp.gmail.com with ESMTPSA id fg2sm35658159pad.23.2016.10.25.14.31.08 (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 25 Oct 2016 14:31:09 -0700 (PDT) Received: from dl.caveonetworks.com (localhost.localdomain [127.0.0.1]) by dl.caveonetworks.com (8.14.5/8.14.5) with ESMTP id u9PLV8uF007301; Tue, 25 Oct 2016 14:31:08 -0700 Received: (from ddaney@localhost) by dl.caveonetworks.com (8.14.5/8.14.5/Submit) id u9PLV7tp007300; Tue, 25 Oct 2016 14:31:07 -0700 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 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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20161025_143132_059031_01E63716 X-CRM114-Status: GOOD ( 15.90 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Daney , Ganapatrao Kulkarni , Robert Richter , Hanjun Guo , Gilbert Netzer MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP 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; }