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=-10.1 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable 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 5CB03C47420 for ; Wed, 30 Sep 2020 15:51:30 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id CA498207C3 for ; Wed, 30 Sep 2020 15:51:29 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alien8.de header.i=@alien8.de header.b="kqAUx6o7" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CA498207C3 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=alien8.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id DD9EF8E0005; Wed, 30 Sep 2020 11:51:28 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D62B78E0001; Wed, 30 Sep 2020 11:51:28 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BDBEE8E0005; Wed, 30 Sep 2020 11:51:28 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0085.hostedemail.com [216.40.44.85]) by kanga.kvack.org (Postfix) with ESMTP id A19E78E0001 for ; Wed, 30 Sep 2020 11:51:28 -0400 (EDT) Received: from smtpin01.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 492D94DA2 for ; Wed, 30 Sep 2020 15:51:28 +0000 (UTC) X-FDA: 77320167456.01.tramp31_2c0726d27194 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin01.hostedemail.com (Postfix) with ESMTP id 186E41004F64C for ; Wed, 30 Sep 2020 15:51:28 +0000 (UTC) X-HE-Tag: tramp31_2c0726d27194 X-Filterd-Recvd-Size: 5216 Received: from mail.skyhub.de (mail.skyhub.de [5.9.137.197]) by imf26.hostedemail.com (Postfix) with ESMTP for ; Wed, 30 Sep 2020 15:51:27 +0000 (UTC) Received: from zn.tnic (p200300ec2f092a00869c7b979af15d7f.dip0.t-ipconnect.de [IPv6:2003:ec:2f09:2a00:869c:7b97:9af1:5d7f]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id 2D0A51EC0445; Wed, 30 Sep 2020 17:51:25 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1601481085; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:in-reply-to:in-reply-to: references:references; bh=8IJoGZzJObE8St80wY9DzpuhEry0/MVi9UTMplvJAkw=; b=kqAUx6o7xOwJppyJb436b4BKze4HaXlnbrBvfP+p8MkQuBxpAJgK0tLtFv4ID9uzNGq/rn tFKrxS+5Iolj5OQ4DpC/m8nov+97uyE1wm5am27Ys0D8CBBf0WaRfFtDC5kmhldJlVYq08 8TvGSl+NZXGtXjRwSx+u33PGNixHZrU= Date: Wed, 30 Sep 2020 17:51:18 +0200 From: Borislav Petkov To: Jonathan Cameron Cc: linux-mm@kvack.org, linux-acpi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, x86@kernel.org, Lorenzo Pieralisi , rafael@kernel.org, Ingo Molnar , Bjorn Helgaas , linux-kernel@vger.kernel.org, Thomas Gleixner , linuxarm@huawei.com, Dan Williams , Brice Goglin , Sean V Kelley , linux-api@vger.kernel.org, Hanjun Guo Subject: Re: [PATCH v12 2/6] x86: Support Generic Initiator only proximity domains Message-ID: <20200930155118.GG6810@zn.tnic> References: <20200930140547.840251-1-Jonathan.Cameron@huawei.com> <20200930140547.840251-3-Jonathan.Cameron@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20200930140547.840251-3-Jonathan.Cameron@huawei.com> 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: On Wed, Sep 30, 2020 at 10:05:43PM +0800, Jonathan Cameron wrote: > In common with memoryless domains only register GI domains > if the proximity node is not online. If a domain is already > a memory containing domain, or a memoryless domain there is > nothing to do just because it also contains a Generic Initiator. > > Signed-off-by: Jonathan Cameron > --- > v12: Update comment to adopt passive voice. > > arch/x86/include/asm/numa.h | 2 ++ > arch/x86/kernel/setup.c | 1 + > arch/x86/mm/numa.c | 21 +++++++++++++++++++++ > 3 files changed, 24 insertions(+) > > diff --git a/arch/x86/include/asm/numa.h b/arch/x86/include/asm/numa.h > index bbfde3d2662f..f631467272a3 100644 > --- a/arch/x86/include/asm/numa.h > +++ b/arch/x86/include/asm/numa.h > @@ -62,12 +62,14 @@ extern void numa_clear_node(int cpu); > extern void __init init_cpu_to_node(void); > extern void numa_add_cpu(int cpu); > extern void numa_remove_cpu(int cpu); > +extern void init_gi_nodes(void); > #else /* CONFIG_NUMA */ > static inline void numa_set_node(int cpu, int node) { } > static inline void numa_clear_node(int cpu) { } > static inline void init_cpu_to_node(void) { } > static inline void numa_add_cpu(int cpu) { } > static inline void numa_remove_cpu(int cpu) { } > +static inline void init_gi_nodes(void) { } > #endif /* CONFIG_NUMA */ > > #ifdef CONFIG_DEBUG_PER_CPU_MAPS > diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c > index 3511736fbc74..9062c146f03a 100644 > --- a/arch/x86/kernel/setup.c > +++ b/arch/x86/kernel/setup.c > @@ -1218,6 +1218,7 @@ void __init setup_arch(char **cmdline_p) > prefill_possible_map(); > > init_cpu_to_node(); > + init_gi_nodes(); > > io_apic_init_mappings(); > > diff --git a/arch/x86/mm/numa.c b/arch/x86/mm/numa.c > index aa76ec2d359b..22d3e5ade3ae 100644 > --- a/arch/x86/mm/numa.c > +++ b/arch/x86/mm/numa.c > @@ -747,6 +747,27 @@ static void __init init_memory_less_node(int nid) > */ > } > > +/* > + * A node may exist which has one or more Generic Initiators but no CPUs and no > + * memory. > + * > + * This function must be called after init_cpu_to_node(), to ensure that any > + * memoryless CPU nodes have already been brought online, and before the > + * node_data[nid] is needed for zone list setup in build_all_zonelists(). > + * > + * When this function is called, any nodes containing either memory and/or CPUs > + * will already be online and there is no need to do anything extra, even if > + * they also contain one or more Generic Initiators. > + */ > +void __init init_gi_nodes(void) > +{ > + int nid; > + > + for_each_node_state(nid, N_GENERIC_INITIATOR) > + if (!node_online(nid)) > + init_memory_less_node(nid); > +} > + > /* > * Setup early cpu_to_node. > * > -- Looks perfect, thanks! :-) Acked-by: Borislav Petkov -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette