Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp4397573ybp; Mon, 7 Oct 2019 07:55:41 -0700 (PDT) X-Google-Smtp-Source: APXvYqw00wQ3yPoY+rwJ+Cs9NJzjq83xzX9WRdUwzX/uJehjnvLeJB3JvEYsuk19MymXT+8Muz3y X-Received: by 2002:a50:886d:: with SMTP id c42mr29354395edc.24.1570460141023; Mon, 07 Oct 2019 07:55:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570460141; cv=none; d=google.com; s=arc-20160816; b=D8HjJaiKv3tBZUHZlDSrMylmcSzwfAjdtZ/3bLrYaFzwJT5xX3N4rHlamhaNr3iSp5 CycBUPRasq8Luskackv+2QyBQHzNyQYDOgyqFcd/JN931oLFgE4W0/ch6+GdaT7DMYg9 wp5utY6rk0N1Z8djFBHen3ZfBEJN+BDXYYG14TObhvFcO1/+qLsZh/or0TPnxDeWR394 mXQ/GokVrFp2DDVog34+6kFG3O0/PAreBEQtIHFAHH16xg36r+tTnUFAsimd18Dx2NIW AScVAVRYKdEeO320cpccrv9uMX8Ouyw/0KY0T/kxeXLgS0YQY9M69nRO/SH2mxiMsCqQ oHyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=zyoLjL42jHZiwxAXIV2/XDf7QRXhcD/Qv0lwPPBYTCw=; b=M1RS4MlNrP/qwxUwR42FNYfv2Ergpm6/iJGMBOwJbETtwA8ioFg8hEDzJQy85rJXH3 BzI86kyaeen0NQsJ8bIhLeOPJLyvM0OAUWINFAPw63tGxI4DjSdbw+ZFIAdx2Q+Gwf8E gRiStLuMFcRmIlZvzQB7rX9BZW8eC8R7f6CRuyV0r+CasxccDHmVX3Ufatgg9MZG8RsJ vs7ANeY15sT2Vmx9WOa7GJiOk/df4DSSuWKaMzQ6gdud4aqxZ2eCqZ1zDxKbvjn06FK1 q78KNjC60z7kYYxgwRMkkgh6PiRQEU8cqtieVUMgD8b4dK2Vw+H16jV/RYcRGNa/t+Qo NvKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=B3otWI4U; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g19si7027928ejw.373.2019.10.07.07.55.17; Mon, 07 Oct 2019 07:55:41 -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; dkim=fail header.i=@gmail.com header.s=20161025 header.b=B3otWI4U; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727931AbfJGOzM (ORCPT + 99 others); Mon, 7 Oct 2019 10:55:12 -0400 Received: from mail-wr1-f67.google.com ([209.85.221.67]:44735 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727490AbfJGOzL (ORCPT ); Mon, 7 Oct 2019 10:55:11 -0400 Received: by mail-wr1-f67.google.com with SMTP id z9so15652577wrl.11; Mon, 07 Oct 2019 07:55:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=zyoLjL42jHZiwxAXIV2/XDf7QRXhcD/Qv0lwPPBYTCw=; b=B3otWI4U0GSNrjqwP6usJ0QsQXw4reQk8JjX63gKbNmDqAXYg4VYGfTbWUjktkuzGX +xaCfb5w2mNmI+cZOUkZOU2oHYUZaeDacr7lOFz0b6bpbtHDBxwDlGimM2pweeUoUckb v71aW6da+G0WmrKWP7WjLNZbCZDKxBxv68vuIk2coAyjeKrN0uLlkMoQjeEjUizhgWhB 81cL91Uw1tAqjPAg4Q1xObpfA9FCGncyUd+XXhjU/zpBiTAHru93glYwQ6hFXRh0jU+c o0lQx8rf0p+RmPNf5M6kyseZ00wCTEeZa7k7f3nPTm7LwKAffx8C99poDTbS0a5pit/4 HeBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=zyoLjL42jHZiwxAXIV2/XDf7QRXhcD/Qv0lwPPBYTCw=; b=MlW0ojwhToYlPfCDYVsgL6bxsaI8PSKD9se19pgLFkzBC1di8Ame4yu0n9sLxvTZ7N LPNA36+M3umUPsZ7V2k7g3Twuq8cZjm4608xYvuW/lcmVDq92A2P7IVJxn6PNQWuMH2h oladtQ9b0xd2HvtC+BMR7OZlxEMDEDJ4Xd1TCHVmqHfW4rWnlz2iQuknzjliGqlkiMUb 2A2r3/6j7B2GLSc33m4MYmWMaywqU86jYXpnEg9o/hbmhHrIJO5Xt5SADzGSB64euEQe aXky1pvmOyBdrV+zCPu8KqY2xaaUIaKp1oTfVoINAVUgRe7rqhLR9tc5CZcLLteyAGpa wu2A== X-Gm-Message-State: APjAAAU0Xt0ESDp0yqiD8NSZa11U4LHGDxea7S9ezVYEbJZ6UOOySJYK 51paO4IydqjJnfi69XJRqZeB28+x X-Received: by 2002:a5d:4689:: with SMTP id u9mr22942357wrq.78.1570460108023; Mon, 07 Oct 2019 07:55:08 -0700 (PDT) Received: from gmail.com (2E8B0CD5.catv.pool.telekom.hu. [46.139.12.213]) by smtp.gmail.com with ESMTPSA id s1sm26307592wrg.80.2019.10.07.07.55.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Oct 2019 07:55:07 -0700 (PDT) Date: Mon, 7 Oct 2019 16:55:05 +0200 From: Ingo Molnar To: Jonathan Cameron Cc: linux-mm@kvack.org, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, x86@kernel.org, Keith Busch , jglisse@redhat.com, "Rafael J . Wysocki" , linuxarm@huawei.com, Andrew Morton , Dan Williams Subject: Re: [PATCH V5 3/4] x86: Support Generic Initiator only proximity domains Message-ID: <20191007145505.GB88143@gmail.com> References: <20191004114330.104746-1-Jonathan.Cameron@huawei.com> <20191004114330.104746-4-Jonathan.Cameron@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191004114330.104746-4-Jonathan.Cameron@huawei.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Jonathan Cameron wrote: > Done in a somewhat different fashion to arm64. > Here the infrastructure for memoryless domains was already > in place. That infrastruture applies just as well to > domains that also don't have a CPU, hence it works for > Generic Initiator Domains. > > In common with memoryless domains we 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 > --- > arch/x86/include/asm/numa.h | 2 ++ > arch/x86/kernel/setup.c | 1 + > arch/x86/mm/numa.c | 14 ++++++++++++++ > 3 files changed, 17 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 cfb533d42371..b6c977907ea5 100644 > --- a/arch/x86/kernel/setup.c > +++ b/arch/x86/kernel/setup.c > @@ -1264,6 +1264,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 4123100e0eaf..50bf724a425e 100644 > --- a/arch/x86/mm/numa.c > +++ b/arch/x86/mm/numa.c > @@ -733,6 +733,20 @@ static void __init init_memory_less_node(int nid) > */ > } > > +/* > + * Generic Initiator Nodes may have neither CPU nor Memory. > + * At this stage if either of the others were present we would > + * already be online. > + */ > +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); > +} Nit: missing curly braces. How do these work in practice, will a system that only had nodes 0-1 today grow a third node '2' that won't have any CPUs on memory on them? Thanks, Ingo