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: 181732 Delivered-To: patch@linaro.org Received: by 2002:ac9:44c4:0:0:0:0:0 with SMTP id t4csp4456849och; Mon, 16 Dec 2019 07:39:10 -0800 (PST) X-Google-Smtp-Source: APXvYqxux44GamoQN96Y+7QnqR/a38JYE2uNrCRLD7iktrGSrvSOr8+N0RM5GdeUKdXGdEa+KAy1 X-Received: by 2002:a9d:7e99:: with SMTP id m25mr3054800otp.212.1576510750313; Mon, 16 Dec 2019 07:39:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576510750; cv=none; d=google.com; s=arc-20160816; b=yGuyTbjf44mvyMdpmVyEPFUwbH+xggj0Gh30PPla1lfq6+rchQe6uybiE6E8yoNdtY HE4qJu5lio8GzEM7xEpTPSBtA5q1GSwhxYL924FNgLn9etxZRXMjszCerfJoR8XuLzv2 qb71VxvF5ybZhp18734/2AFrORWkO+eDkamjvCfDO/aBszaHDuU0Yt42NaQeaUpoD5Ta WAVKLK/a3dPerDyshfA4s6cRRoZZURT6+jt5FSO9sJpebyKY56zLYVQLrRfFMvp6uS3B m2p+xbENBLkjJZAs4IHZLw1dWwsFQ8S97eF8omd5e+k2gGB0+0MlsdY9guqVxF1f4ayt E8vw== 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=njb6DQZ7gaEzx4PKISLGbxSFVYqBkbyxzkqmU/A7QbY=; b=t0aER7NT5HEy1O9SStSW2yfucC99DPM6Cra6sekabu0cvpXay3kYI+uJwEhAym56b3 +F0x/ueBUC3aVPok1wKiS+qS9Om4HEzFBzhfkx7H5uhp+kY5lMeXMneHA+js8AH/hRA/ IDzAtiqcxBrQsTNE0OxAopJgNbFyyDTsfEdlXBqLm/+Ca9+4VAnw+ycyIyXY/cGkki2G ujrMq6/3Y3o5xqEzpU+Oc4+4YJrzRabViCIDCnt3wwcFfM6W6PLe6h8H5TF9L96DNago CooTY9+nd9sgaXLqmI76epKzxupEpCKJMFmlEETJscqbE8R5g3lz1E3satRzbKtUmC0P dTsg== 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 c10si11102645oto.293.2019.12.16.07.39.10; Mon, 16 Dec 2019 07:39:10 -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 S1728502AbfLPPjJ (ORCPT + 27 others); Mon, 16 Dec 2019 10:39:09 -0500 Received: from szxga06-in.huawei.com ([45.249.212.32]:40648 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728337AbfLPPjI (ORCPT ); Mon, 16 Dec 2019 10:39:08 -0500 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: , , , , 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 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 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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 --- arch/arm64/kernel/smp.c | 8 ++++++++ 1 file changed, 8 insertions(+) -- 2.19.1 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);