From patchwork Mon Dec 16 15:38:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 181733 Delivered-To: patch@linaro.org Received: by 2002:ac9:44c4:0:0:0:0:0 with SMTP id t4csp4456901och; Mon, 16 Dec 2019 07:39:14 -0800 (PST) X-Google-Smtp-Source: APXvYqx2TKifLprs/0cmS6Nz4bQaqzr/EGzNaQRBJJVMQgbnOuuDILkZPQUaojtX7Eibj/o/QKDq X-Received: by 2002:aca:f1d4:: with SMTP id p203mr9565055oih.116.1576510754122; Mon, 16 Dec 2019 07:39:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576510754; cv=none; d=google.com; s=arc-20160816; b=JyWVrz74oi14Mm7RqsLW+yqBgDYeXQBJU7D/wIBn1IoMF5+ap48DVU0j42Eze7c4Zz 5ZTtrkfF+X+57iBNtat1EEUyr2uM1uGfnnQ1C0T40gx7I47W8nrDpGg520HV5TyoybuL YoVCH8aGaAlRmxRicZpHikA7X2KZm4Q0cNqk2l1XrXpG+43f4fsLmcB1TnGwSCT/C/B7 J+UPndela+q6PpLDdn+fend6juBrCSlqMjZOkP53lQcYKp3/9cNoTd4GA8EUksGruD9N bVb/mQLlUhO1K//wdhG7S54GyaUvWvWucodzg15TQpY68dPsZ2rA7BBWMTpkxE1pv84k H1PQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=qP8xRfhkWQXV+pfJFYFyaC1byBz/FCkuypyjMcqO1fY=; b=ygsRcLd6GdnIzcrAvy2/FL21klF3fiPxyvbsR6HEzhNCx3EEtaqcTu2OWgpLJlmWb1 qkx0Q5lDP0iVRt0bcXJAIjc90PsdD6cbXEojeAuySUg7ENQxmocSEJDyf6RDbw2eRwXz v+qfYUv660nl+6tRDccUzWRWx2mY9V4IX/6zEC0YDrRYxD+HL3ELlIZawE+CoAK16OEM PDl5gToZsHFuiyAbFl98BqzyTSLyp4XqR8yELSVjBYmjP2frA+ordS7pNif8XcheHAcY QI+HulDlGGtFyaHTvBQjR2AM2D1e5eRoApONNVrRgq791CqJqNcL+5/a76yCxjMbisZJ 3dtw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a197si10796356oii.199.2019.12.16.07.39.13; Mon, 16 Dec 2019 07:39:14 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728248AbfLPPjM (ORCPT + 27 others); Mon, 16 Dec 2019 10:39:12 -0500 Received: from szxga06-in.huawei.com ([45.249.212.32]:40762 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728337AbfLPPjL (ORCPT ); Mon, 16 Dec 2019 10:39:11 -0500 Received: from DGGEMS405-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 6AB2D10314FD91876B55; Mon, 16 Dec 2019 23:39:08 +0800 (CST) Received: from lhrphicprd00229.huawei.com (10.123.41.22) by DGGEMS405-HUB.china.huawei.com (10.3.19.205) with Microsoft SMTP Server id 14.3.439.0; Mon, 16 Dec 2019 23:39:01 +0800 From: Jonathan Cameron To: , , , , CC: Keith Busch , , "Rafael J . Wysocki" , , Andrew Morton , Dan Williams , Tao Xu , Brice Goglin , Lorenzo Pieralisi , Hanjun Guo , Sudeep Holla , Jonathan Cameron Subject: [PATCH V6 3/7] x86: Support Generic Initiator only proximity domains Date: Mon, 16 Dec 2019 23:38:05 +0800 Message-ID: <20191216153809.105463-4-Jonathan.Cameron@huawei.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20191216153809.105463-1-Jonathan.Cameron@huawei.com> References: <20191216153809.105463-1-Jonathan.Cameron@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.123.41.22] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Done in a somewhat different fashion to arm64. Here the infrastructure for memoryless domains was already in place. That infrastruture applies just as well to domains that also don't have a CPU, hence it works for Generic Initiator Domains. In common with memoryless domains we only register GI domains if the proximity node is not online. If a domain is already a memory containing domain, or a memoryless domain there is nothing to do just because it also contains a Generic Initiator. Signed-off-by: Jonathan Cameron --- arch/x86/include/asm/numa.h | 2 ++ arch/x86/kernel/setup.c | 1 + arch/x86/mm/numa.c | 14 ++++++++++++++ 3 files changed, 17 insertions(+) -- 2.19.1 diff --git a/arch/x86/include/asm/numa.h b/arch/x86/include/asm/numa.h index bbfde3d2662f..f631467272a3 100644 --- a/arch/x86/include/asm/numa.h +++ b/arch/x86/include/asm/numa.h @@ -62,12 +62,14 @@ extern void numa_clear_node(int cpu); extern void __init init_cpu_to_node(void); extern void numa_add_cpu(int cpu); extern void numa_remove_cpu(int cpu); +extern void init_gi_nodes(void); #else /* CONFIG_NUMA */ static inline void numa_set_node(int cpu, int node) { } static inline void numa_clear_node(int cpu) { } static inline void init_cpu_to_node(void) { } static inline void numa_add_cpu(int cpu) { } static inline void numa_remove_cpu(int cpu) { } +static inline void init_gi_nodes(void) { } #endif /* CONFIG_NUMA */ #ifdef CONFIG_DEBUG_PER_CPU_MAPS diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c index cedfe2077a69..c21fc5b9f729 100644 --- a/arch/x86/kernel/setup.c +++ b/arch/x86/kernel/setup.c @@ -1279,6 +1279,7 @@ void __init setup_arch(char **cmdline_p) prefill_possible_map(); init_cpu_to_node(); + init_gi_nodes(); io_apic_init_mappings(); diff --git a/arch/x86/mm/numa.c b/arch/x86/mm/numa.c index 99f7a68738f0..53ac09f6138c 100644 --- a/arch/x86/mm/numa.c +++ b/arch/x86/mm/numa.c @@ -733,6 +733,20 @@ static void __init init_memory_less_node(int nid) */ } +/* + * Generic Initiator Nodes may have neither CPU nor Memory. + * At this stage if either of the others were present we would + * already be online. + */ +void __init init_gi_nodes(void) +{ + int nid; + + for_each_node_state(nid, N_GENERIC_INITIATOR) + if (!node_online(nid)) + init_memory_less_node(nid); +} + /* * Setup early cpu_to_node. *