From patchwork Mon Dec 16 15:38:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 11294429 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9FE376C1 for ; Mon, 16 Dec 2019 15:39:48 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 789B0205C9 for ; Mon, 16 Dec 2019 15:39:48 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="QPosbqDD" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 789B0205C9 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=huawei.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=OD3xdVK1Rm/jBeclHMYG7MZWVkk4/uV0lkNz+VcFSyg=; b=QPosbqDDD9lovq /oU/aGfKuPU32reCoUxdSt7YoZ/FCAhOClewR+Glw4yMr/t8Xcv0yTHG1K+MIXdfsdCexK5PiqWyp A/bDeM73sbyzaR1p6PKl9WZBRJerMw2o7ro0TPJIu0vq9DMgQazkeI6p+yqDEUDhJAc85PDvVv3Wv Abx/gxlnFyIRuURiqnycGXqVbSSAakpTJAgq16LQcRDUB4KEtmn/cAf3SsqOT3KDE2/la55slHAjt vNW4nG77yvw+9Q9PGlqqBBvQS/ID3PIyRjbGYaRzznvlH+jnTYT4mv7/ZF/pO4EI5KNxrv3n+dcuf eJdiESA2ygzgmgfd6QFA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1igsTL-00043q-CL; Mon, 16 Dec 2019 15:39:47 +0000 Received: from szxga06-in.huawei.com ([45.249.212.32] helo=huawei.com) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1igsSj-0003U4-D5 for linux-arm-kernel@lists.infradead.org; Mon, 16 Dec 2019 15:39:11 +0000 Received: from DGGEMS405-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 5B48DCA6A2C002DBDA19; Mon, 16 Dec 2019 23:39:03 +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:38:57 +0800 From: Jonathan Cameron To: , , , , Subject: [PATCH V6 2/7] arm64: Support Generic Initiator only domains Date: Mon, 16 Dec 2019 23:38:04 +0800 Message-ID: <20191216153809.105463-3-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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191216_073910_017620_85B2345C X-CRM114-Status: GOOD ( 10.11 ) X-Spam-Score: -2.3 (--) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-2.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [45.249.212.32 listed in list.dnswl.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Lorenzo Pieralisi , Brice Goglin , Tao Xu , Sudeep Holla , "Rafael J . Wysocki" , linuxarm@huawei.com, Keith Busch , jglisse@redhat.com, Jonathan Cameron , Hanjun Guo , Dan Williams , Andrew Morton Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.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 --- arch/arm64/kernel/smp.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/arch/arm64/kernel/smp.c b/arch/arm64/kernel/smp.c index d4ed9a19d8fe..eb5ef84fe7b9 100644 --- a/arch/arm64/kernel/smp.c +++ b/arch/arm64/kernel/smp.c @@ -716,6 +716,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(); @@ -754,6 +755,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);