From patchwork Tue Oct 15 21:07:44 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Toshi Kani X-Patchwork-Id: 3048601 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 9B172BF924 for ; Tue, 15 Oct 2013 21:11:48 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C9448202B8 for ; Tue, 15 Oct 2013 21:11:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E421320117 for ; Tue, 15 Oct 2013 21:11:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933809Ab3JOVLp (ORCPT ); Tue, 15 Oct 2013 17:11:45 -0400 Received: from g4t0015.houston.hp.com ([15.201.24.18]:4725 "EHLO g4t0015.houston.hp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933769Ab3JOVLp (ORCPT ); Tue, 15 Oct 2013 17:11:45 -0400 Received: from g9t2301.houston.hp.com (g9t2301.houston.hp.com [16.216.185.78]) by g4t0015.houston.hp.com (Postfix) with ESMTP id B6C44801D; Tue, 15 Oct 2013 21:11:43 +0000 (UTC) Received: from misato.fc.hp.com (misato.fc.hp.com [16.71.12.41]) by g9t2301.houston.hp.com (Postfix) with ESMTP id AA9D68E; Tue, 15 Oct 2013 21:11:42 +0000 (UTC) From: Toshi Kani To: mingo@kernel.org, hpa@zytor.com, tglx@linutronix.de Cc: akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, x86@kernel.org, linux-pci@vger.kernel.org, yinghai@kernel.org, tj@kernel.org, rientjes@google.com, isimatu.yasuaki@jp.fujitsu.com, Toshi Kani Subject: [PATCH] x86/numa: Allow node distance table to have I/O nodes Date: Tue, 15 Oct 2013 15:07:44 -0600 Message-Id: <1381871264-14070-1-git-send-email-toshi.kani@hp.com> X-Mailer: git-send-email 1.8.3.1 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,KHOP_BIG_TO_CC, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP When a system has I/O devices (ex. PCI bridges) with their own locality, the following error message shows up. NUMA: Warning: node ids are out of bound, from=-1 to=-1 distance=10 acpi_numa_slit_init() calls numa_set_distance(), which assumes that all nodes on the system have been parsed with SRAT already. However, SRAT does not list I/O devices. SLIT has the distance table for all localities including I/Os. Hence, the above message shows up when a system has a unique I/O device locality. This patch changes acpi_numa_slit_init() to make sure all the nodes are parsed, so that it can initialize the distance table with all the localities. The following map tables may contain I/O nodes as a result. - numa_distance[], i.e. node distance table - node_states[N_POSSIBLE], aka. node_possible_map - mp_bus_to_node[], i.e. pci bus# to node# map There is no functional change since there is no code that makes use of the I/O nodes. - I/O nodes are set to off-line. - pci_acpi_scan_root() continues to set -1 to pci_sysdata.node of a PCI bridge with a unique locality (per commit b755de8d). Signed-off-by: Toshi Kani --- arch/x86/mm/srat.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) -- 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/mm/srat.c b/arch/x86/mm/srat.c index 26f4e12..fb5bd73 100644 --- a/arch/x86/mm/srat.c +++ b/arch/x86/mm/srat.c @@ -45,7 +45,20 @@ static __init inline int srat_disabled(void) /* Callback for SLIT parsing */ void __init acpi_numa_slit_init(struct acpi_table_slit *slit) { - int i, j; + int node, i, j; + + /* SLIT may have I/O nodes, which are not listed in SRAT */ + for (i = 0; i < slit->locality_count; i++) { + if (pxm_to_node(i) != NUMA_NO_NODE) + continue; + + node = setup_node(i); + if (WARN_ONCE(node < 0, "SLIT: Too many proximity domains.\n")) + continue; + + node_set(node, numa_nodes_parsed); + pr_info("SLIT: Node %u PXM %u I/O only\n", node, i); + } for (i = 0; i < slit->locality_count; i++) for (j = 0; j < slit->locality_count; j++)