From patchwork Mon Apr 1 15:36:02 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 161541 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp612736jan; Mon, 1 Apr 2019 08:37:10 -0700 (PDT) X-Google-Smtp-Source: APXvYqx62wVUYCLY+07Osy2wpDlrDyDvGf+5wqjVkwViA88GTLR2Jc/NnBkCx/wSjy35irUYvdKF X-Received: by 2002:a65:47c6:: with SMTP id f6mr44209252pgs.173.1554133030606; Mon, 01 Apr 2019 08:37:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554133030; cv=none; d=google.com; s=arc-20160816; b=bsM3E4VNuv8wvY3/hHwQulXyvSLj30hyWpzrxve5jLgifefzVunn9ApE6GwBwk87OC X3PiJlzExcX7Hh77tNzJFdvizlRBLFx6sWhor/W2slL/jZMxOyJGDTauWIQAAHlLUMY6 2dRTYzY3fuDakyC8gFplaFD2gAypW4yH/3tvXoZ5179sn3SXIThiIr2XwzgiW5gluRju 806sCuStKB0PCWMfdOVasnifFdB4L90xA1HgTUvUNKZTB4zZQtj04omeH30SSIzC0DxG +d03UuYEcLFYnurfDG6jiberGllLv5lb1ch9ZMN4e69mFYWwQXwuoYFSsH0g8TtWugK+ 92jQ== 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=61stFUUPLpdAiuhmZhpg/q03iwVZnrncM5USLAYyWqw=; b=c/LJArwKUYCy+x/bQDtztXNXPCwwFpmnn3pspob0a8x63JEUjQCavofCnJvisADkct mzrf+wgWJ9nRE4uMkxwbS/CXPtNQGcgS+se8RNDVPLLe3HSTETW+riBvlPg9JuNyiWLZ 6pmAjyxD3GzN8bi6NAT8i9rhEKoJ2x5sxdp5ADtqNqsg7V1S1/ngOloT1mJ3nNhTS+tM uHLtMBiZUuIwR8gFOC+pUdvwIxOpVi+T6arprqcaXSWG9+TByammt5WHshek9UketApQ /PFfNKClQnaW5+7VxMXYQICRfCPk4SK/0KE7LV7z4sVVzfWCQlS5AfVTprIwXgndhuDm YcOg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-acpi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-acpi-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 h126si8728458pgc.365.2019.04.01.08.37.10; Mon, 01 Apr 2019 08:37:10 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-acpi-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-acpi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-acpi-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726905AbfDAPhK (ORCPT + 9 others); Mon, 1 Apr 2019 11:37:10 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:6209 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726514AbfDAPhJ (ORCPT ); Mon, 1 Apr 2019 11:37:09 -0400 Received: from DGGEMS414-HUB.china.huawei.com (unknown [10.3.19.214]) by Forcepoint Email with ESMTP id 8A316E99E30CD57CC18A; Mon, 1 Apr 2019 23:37:06 +0800 (CST) Received: from FRA1000014316.huawei.com (100.126.230.97) by DGGEMS414-HUB.china.huawei.com (10.3.19.214) with Microsoft SMTP Server id 14.3.408.0; Mon, 1 Apr 2019 23:36:57 +0800 From: Jonathan Cameron To: , , CC: , , , , Jonathan Cameron Subject: [RFC PATCH v2 2/3] arm64: Support Generic Initiator only domains Date: Mon, 1 Apr 2019 23:36:02 +0800 Message-ID: <20190401153603.67775-3-Jonathan.Cameron@huawei.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190401153603.67775-1-Jonathan.Cameron@huawei.com> References: <20190401153603.67775-1-Jonathan.Cameron@huawei.com> MIME-Version: 1.0 X-Originating-IP: [100.126.230.97] Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org The one thing that currently needs doing from an architecture point of view is associating the GI domain with its nearest memory domain. This allows all the standard NUMA aware code to get a 'reasonable' answer. A clever driver might elect to do load balancing etc if there are multiple host / memory domains nearby, but that's a decision for the driver. Signed-off-by: Jonathan Cameron --- I plan to test on x86 qemu, but if anyone has hardware where this makes sense then that would be even better. arch/arm64/kernel/smp.c | 8 ++++++++ 1 file changed, 8 insertions(+) -- 2.18.0 diff --git a/arch/arm64/kernel/smp.c b/arch/arm64/kernel/smp.c index 824de7038967..7c419bf92374 100644 --- a/arch/arm64/kernel/smp.c +++ b/arch/arm64/kernel/smp.c @@ -731,6 +731,7 @@ void __init smp_prepare_cpus(unsigned int max_cpus) { int err; unsigned int cpu; + unsigned int node; unsigned int this_cpu; init_cpu_topology(); @@ -769,6 +770,13 @@ void __init smp_prepare_cpus(unsigned int max_cpus) set_cpu_present(cpu, true); numa_store_cpu_info(cpu); } + + /* + * Walk the numa domains and set the node to numa memory reference + * for any that are Generic Initiator Only. + */ + for_each_node_state(node, N_GENERIC_INITIATOR) + set_gi_numa_mem(node, local_memory_node(node)); } void (*__smp_cross_call)(const struct cpumask *, unsigned int);