From patchwork Fri Oct 4 11:43:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 175216 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp581037ill; Fri, 4 Oct 2019 04:44:24 -0700 (PDT) X-Google-Smtp-Source: APXvYqzRCVquBzZaxE41eBduDvAf9/NEKmMsO/vPFD6Oc8cb5shj7qqx2FppbylM3Jp6igXy9UWd X-Received: by 2002:aa7:c40c:: with SMTP id j12mr14929102edq.284.1570189464762; Fri, 04 Oct 2019 04:44:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570189464; cv=none; d=google.com; s=arc-20160816; b=XZ3YrOLX5nEn9uF8ffOb2dOmE/XX7GAPsn/j1qL6yNUxJy8gO6QdmqRoV+hhpJ172G aQuJsr+THXkMEdIp7WUNC6L+ZaZe4A2m8aNz2b3Iy6ls7+DDYjfoOWPW2jqYudy3/7jB q66P3CObShjLEyAIbmEC3qjj0hRL4Rx/S89aeZ9Ms5W+mC8OghuA8luuwmwgq7YPCwjo +BnCrh5gHPHRDM3VGQ0c9nnfC/Z3h68e4c6Nq2TX6oOslQX5NVssxyEaOVsIp4ySxmz6 NhpiACOcUohRpO35diG8J6H200ICq8vQ0g8Ep9A6uYLFIDs1G+yLDwy/7GZ4e4L9MC4W d1Cw== 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 e46si3426846eda.401.2019.10.04.04.44.24; Fri, 04 Oct 2019 04:44:24 -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 S1731157AbfJDLoW (ORCPT + 27 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 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.20.1 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);