From patchwork Tue Feb 12 16:49:25 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 158159 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp4059913jaa; Tue, 12 Feb 2019 08:50:40 -0800 (PST) X-Google-Smtp-Source: AHgI3IYgdU0yEOkSmddWXH0QESFi7Q4tY0t6B9HNoXLiobISSf/Q/QT8LVxllXfFuLnX6JLb16ew X-Received: by 2002:a63:d50c:: with SMTP id c12mr4473125pgg.32.1549990240373; Tue, 12 Feb 2019 08:50:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549990240; cv=none; d=google.com; s=arc-20160816; b=TU+q7OC/7+OsS5wgvgNVUYVQcnBOxx5IlhWM6XCVlQTetWdpP3Ed1LNPGJIK1DVJSB 9op2bbBv6+fIn+QIe65DZqdbxqrKPNka4WQUzZEF7nK4hKtC3zLRJy31HrPBImWi5297 QdlPRUOGQQwuEessZfvkmtSUepfdDgONRYt4nOb+ecx3l+x+21K//xN6whgC6YLPQTRB HZYEtKKFjtvtPxVOobKqsPE5M5p+UwLcT/kK1MXij9KKn26KBHDbXNYFoWwGwPz0gHKg ePPcrRif0GzZd5xPsHZHVPpeGniop9UT+FpKFPQzkxnSkkwTnRdYV8VG2M7QYqtB0l1a GzKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=1mN7iMooA3KVd0qWi1NHOaj1xqcTLIgTbwO9dW7o6Nw=; b=0gUikefg92wtD24hLZFY/KYTNkwm/i//v4z3yPLoP9/e5Ye31k3pdJxRYCdy68nPUK 90bkesTAO/Q6Dgn5mJrJLfr9ahtLoCkc7WKjPluuYT7Jdm34kFC7R8bqmmcZq0HJXZii miffyE4NpfScIlI/xEk5RZCFL4M9bNc0oFgNlNvHuF2b6P9BOxkO767i+SjXzrpKCk35 VhHm/KdgBeK24rvkIX4znoNaiPcv4wkZjcQXNDdCBh0F4CB1TjF0vOuBDP5YSdAGAAWt VxHho0f+5MQzWGgmsvtM3Vp8nCOVGLN+uXCdgaRRkrJbH3PEj/GmRA9R6c8f7sZWjU9f 5GgQ== 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 y15si219506pll.148.2019.02.12.08.50.39; Tue, 12 Feb 2019 08:50:40 -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 S1728035AbfBLQui (ORCPT + 31 others); Tue, 12 Feb 2019 11:50:38 -0500 Received: from szxga04-in.huawei.com ([45.249.212.190]:3191 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727986AbfBLQuh (ORCPT ); Tue, 12 Feb 2019 11:50:37 -0500 Received: from DGGEMS414-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id C2159F346FEF718CFC8E; Wed, 13 Feb 2019 00:50:31 +0800 (CST) Received: from j00421895-HPW10.huawei.com (10.202.226.61) by DGGEMS414-HUB.china.huawei.com (10.3.19.214) with Microsoft SMTP Server id 14.3.408.0; Wed, 13 Feb 2019 00:50:22 +0800 From: Jonathan Cameron To: , , , CC: , =?utf-8?b?SsOpcsO0bWUgR2xpc3Nl?= , Keith Busch , "Rafael J . Wysocki" , Michal Hocko , , Jonathan Cameron Subject: [PATCH 2/3] arm64: Support Generic Initiator only domains Date: Tue, 12 Feb 2019 16:49:25 +0000 Message-ID: <20190212164926.202-3-Jonathan.Cameron@huawei.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190212164926.202-1-Jonathan.Cameron@huawei.com> References: <20190212164926.202-1-Jonathan.Cameron@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.202.226.61] 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.18.0 diff --git a/arch/arm64/kernel/smp.c b/arch/arm64/kernel/smp.c index 1598d6f7200a..871d2d21afb3 100644 --- a/arch/arm64/kernel/smp.c +++ b/arch/arm64/kernel/smp.c @@ -698,6 +698,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(); @@ -736,6 +737,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);