Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp786785ybp; Fri, 4 Oct 2019 05:05:00 -0700 (PDT) X-Google-Smtp-Source: APXvYqyN0oVPKlZ/P0tsn5BL9Eo0B+wW583If08km0+ut+oogtWFoM/ysf66c2wFSqHyw1aWoK5H X-Received: by 2002:a50:da44:: with SMTP id a4mr14964484edk.120.1570190700489; Fri, 04 Oct 2019 05:05:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570190700; cv=none; d=google.com; s=arc-20160816; b=pUaR61rwUQoHzp+rwtd3mWi75YRlcOSgWg8WJoVLalMgUdE561ncldUaTiHEawgyON A1oIweFZ3GxzLw5Fhf2uwY+ymR+RygE5nvGJB+Un5K0lUbwkFxW7ToKgWxgrVQT/+Ard wB967DyqWhyKffZt7nyV2miWrQL6/51+it/SwbsCB77aFW0/XoVYz8j44ysfB3hkIah1 WGb2/nNuH5oVFltt8s8rHANEABIjPb/hwUNN7TvDWe/eJqU2LqiTysCE/eKUTwYUa1Rr Q/TJIRzohT7JnBq2h27fzqmJNzJsfjAj8fWHFaOc7rEXBkGhvcMHR3z19LTJsxerWmS1 LAKQ== 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=xikcicRedvBNUu590sgXLCoL/c6CWMuoFs4DnKOSVRM=; b=NJsrjWXYjHN31vVJdN7VauoKloBdD0wgauhz+zVZ2PuXqT/NhfZcHg1tNrT16ovJEL e/EN04dGMQG0rla2VIpvqpBHh2KcGN3A9ZNVUu4u0RZe4rPbBmJWVIwkY5QEeKH+LSDT J+mzTLVL24u2bmQPvkN/9GmnUg5u0af/9D3kAMyQaeCHwrAQwbIZ/R/NfirKc1mwzPAD WloMru058Sfrh/eFyAmalcxN0cDBi8QE/Rxm0bdaRh6q+5y8N9U91NfdXinp5Gmkrlwu 8AhQVA+J5jgtlpydnspWAzc2rJrMD/iSq04aVwSSW5Wv2osrTtrohnvRy5BxdpuNLE/z XmYw== 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 90si3890005edj.72.2019.10.04.05.04.35; Fri, 04 Oct 2019 05:05:00 -0700 (PDT) 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 S1731145AbfJDLoW (ORCPT + 99 others); Fri, 4 Oct 2019 07:44:22 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:36446 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726024AbfJDLoV (ORCPT ); Fri, 4 Oct 2019 07:44:21 -0400 Received: from DGGEMS401-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 3AD602401994882FD419; Fri, 4 Oct 2019 19:44:20 +0800 (CST) Received: from lhrphicprd00229.huawei.com (10.123.41.22) by DGGEMS401-HUB.china.huawei.com (10.3.19.201) with Microsoft SMTP Server id 14.3.439.0; Fri, 4 Oct 2019 19:44:12 +0800 From: Jonathan Cameron To: , , , , CC: Keith Busch , , "Rafael J . Wysocki" , , Andrew Morton , Dan Williams , Jonathan Cameron Subject: [PATCH V5 2/4] arm64: Support Generic Initiator only domains Date: Fri, 4 Oct 2019 19:43:28 +0800 Message-ID: <20191004114330.104746-3-Jonathan.Cameron@huawei.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191004114330.104746-1-Jonathan.Cameron@huawei.com> References: <20191004114330.104746-1-Jonathan.Cameron@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII 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(+) diff --git a/arch/arm64/kernel/smp.c b/arch/arm64/kernel/smp.c index dc9fe879c279..fd7f6b1cdc84 100644 --- a/arch/arm64/kernel/smp.c +++ b/arch/arm64/kernel/smp.c @@ -713,6 +713,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(); @@ -751,6 +752,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); -- 2.20.1