From patchwork Mon Apr 1 15:36:02 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 10880185 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3DFDA14DE for ; Mon, 1 Apr 2019 15:37:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2466C2867F for ; Mon, 1 Apr 2019 15:37:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1868428785; Mon, 1 Apr 2019 15:37:37 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 9B29D28786 for ; Mon, 1 Apr 2019 15:37:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Xagk610GZjOo7EyMQKL78ViuAW27D5pudfcbhH6lgfE=; b=ZUhgXKZC3iUkBP HZ9DhBa3HloZX00zlmiVdFAX+aqv2gebUQB9yknnXpt7RIYLDZeKQZiberYstaQzlewqMoA5jY7EV dz/lHQe9d/5XNq8B+SXS0jckW1VAVP5fal+iIKn5xKJwbIKRZCiYm5t76M/i5Mg5oY+19wQMLnrRp 42m68Ij6TaSJ7AHuoy1rMl8QqLbhSLdwMYqbNf6v7b0DUksYpHDAaeYR3pmCA91aahKaZBUessIVS 0WcfKCPWr/Dpypgp4a/1ax1J8UvidvIVWp0aVesQB6GpndDoU+7OY76YMZOE0+MQrInNl+r/wBNzc gYnH4zNtJvSNSYbQ3GEQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hAz06-0006FD-38; Mon, 01 Apr 2019 15:37:30 +0000 Received: from szxga05-in.huawei.com ([45.249.212.191] helo=huawei.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hAyzl-0005jf-Pp for linux-arm-kernel@lists.infradead.org; Mon, 01 Apr 2019 15:37:12 +0000 Received: from DGGEMS414-HUB.china.huawei.com (unknown [10.3.19.214]) by Forcepoint Email with ESMTP id 8A316E99E30CD57CC18A; Mon, 1 Apr 2019 23:37:06 +0800 (CST) Received: from FRA1000014316.huawei.com (100.126.230.97) by DGGEMS414-HUB.china.huawei.com (10.3.19.214) with Microsoft SMTP Server id 14.3.408.0; Mon, 1 Apr 2019 23:36:57 +0800 From: Jonathan Cameron To: , , Subject: [RFC PATCH v2 2/3] arm64: Support Generic Initiator only domains Date: Mon, 1 Apr 2019 23:36:02 +0800 Message-ID: <20190401153603.67775-3-Jonathan.Cameron@huawei.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190401153603.67775-1-Jonathan.Cameron@huawei.com> References: <20190401153603.67775-1-Jonathan.Cameron@huawei.com> MIME-Version: 1.0 X-Originating-IP: [100.126.230.97] X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190401_083710_113155_81B32090 X-CRM114-Status: GOOD ( 10.18 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: keith.busch@intel.com, jglisse@redhat.com, rjw@rjwysocki.net, linuxarm@huawei.com, Jonathan Cameron Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- I plan to test on x86 qemu, but if anyone has hardware where this makes sense then that would be even better. 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 824de7038967..7c419bf92374 100644 --- a/arch/arm64/kernel/smp.c +++ b/arch/arm64/kernel/smp.c @@ -731,6 +731,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(); @@ -769,6 +770,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);