From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C8DB5C3A5A2 for ; Wed, 21 Aug 2019 14:53:30 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 96BA323400 for ; Wed, 21 Aug 2019 14:53:30 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 96BA323400 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=huawei.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 2549A6B02C9; Wed, 21 Aug 2019 10:53:30 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1E07F6B02CA; Wed, 21 Aug 2019 10:53:30 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 02F906B02CB; Wed, 21 Aug 2019 10:53:29 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0204.hostedemail.com [216.40.44.204]) by kanga.kvack.org (Postfix) with ESMTP id CDFC76B02C9 for ; Wed, 21 Aug 2019 10:53:29 -0400 (EDT) Received: from smtpin28.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with SMTP id 797DE8248ABE for ; Wed, 21 Aug 2019 14:53:29 +0000 (UTC) X-FDA: 75846728538.28.cow78_1e5536c12ec5d X-HE-Tag: cow78_1e5536c12ec5d X-Filterd-Recvd-Size: 2789 Received: from huawei.com (szxga05-in.huawei.com [45.249.212.191]) by imf19.hostedemail.com (Postfix) with ESMTP for ; Wed, 21 Aug 2019 14:53:28 +0000 (UTC) Received: from DGGEMS407-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id A01EA1FB20CC1D5D76A0; Wed, 21 Aug 2019 22:53:11 +0800 (CST) Received: from lhrphicprd00229.huawei.com (10.123.41.22) by DGGEMS407-HUB.china.huawei.com (10.3.19.207) with Microsoft SMTP Server id 14.3.439.0; Wed, 21 Aug 2019 22:53:04 +0800 From: Jonathan Cameron To: , , , CC: Keith Busch , , "Rafael J . Wysocki" , , Andrew Morton , Dan Williams , Jonathan Cameron Subject: [PATCH 2/4] arm64: Support Generic Initiator only domains Date: Wed, 21 Aug 2019 22:52:40 +0800 Message-ID: <20190821145242.2330-3-Jonathan.Cameron@huawei.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190821145242.2330-1-Jonathan.Cameron@huawei.com> References: <20190821145242.2330-1-Jonathan.Cameron@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.123.41.22] X-CFilter-Loop: Reflected Content-Transfer-Encoding: quoted-printable X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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 018a33e01b0e..7c11bc6cccf2 100644 --- a/arch/arm64/kernel/smp.c +++ b/arch/arm64/kernel/smp.c @@ -711,6 +711,7 @@ void __init smp_prepare_cpus(unsigned int max_cpus) { int err; unsigned int cpu; + unsigned int node; unsigned int this_cpu; =20 init_cpu_topology(); @@ -749,6 +750,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)); } =20 void (*__smp_cross_call)(const struct cpumask *, unsigned int); --=20 2.20.1