Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp5227911imm; Tue, 19 Jun 2018 07:09:50 -0700 (PDT) X-Google-Smtp-Source: ADUXVKILxa8gkgEI+cPvjBxq46foYgFhvNweVnO0HErLeyJjvTCYnbR0J+LLIM7162CGUcnquqhi X-Received: by 2002:a17:902:7089:: with SMTP id z9-v6mr18965857plk.231.1529417390248; Tue, 19 Jun 2018 07:09:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529417390; cv=none; d=google.com; s=arc-20160816; b=Kqg9yqV9qBvTnCUNNv7BkqfsSlkBLk4Jl9t0o9RrvYMMqyPp/7bPcnodlE+ql70bmG 454NermJniNHvmuiQu3TOLDE2RFs2cr5mg9dMiRY0c+txaldA3UCkouEwnTojrqRIDgc gb8XkZqfhw6vRAx7bdfHqc096IT634c3V2ZsLvSIL6Jy6x9gDQIphW9oEpP1sHYJxUog 5mtXmhotoIE40oq0mYMBOHGdBqjxWd3eyUYbRTQ0ZhfuvKGITvWlI3Gu6c/D7UZOcS8Z TuECrzQ6hqz9iUbN2ox685nZB8QdJwLygwU38D1V7SE8RR1QJDTpv/x2U+sR5ais1Umq R9hw== 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:arc-authentication-results; bh=2h3zA+92HiNZGkPoq4dRbxQH2Z8FPahauF2q5uJRQ3E=; b=FVJKYh7tkxLIGdcl2rQ+bextH4+xQCf6t5kiN3FChj/RkEUNQYZ0UoVxfQ4Bu8PFOV O5fWnA6/dumpSKSeEMZTluCavaEoNJs400p5Rvus2cJ0wzJ5vZE8ozpSOIm/bp510Y2P 19S7mwB35DlHpq3vRU4CsFJpP0cynr61YZoNuWLuwx7z/HJXEVl9I1vNwnAw/VAFx5ZD kK5swUx8lVo5q2rDWuP58gun34JhEUXQpd6r7G0DLF2KwHZoi88FB/3yqVrPfYswWaLj f+cikFrDKUu4s7Ohy43Q2pofUhgijSnBlGx2bibfTpRJ3Kj0O6ezffrkEAqfwklVRMJx j/IA== 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 z7-v6si14367423pgz.284.2018.06.19.07.09.33; Tue, 19 Jun 2018 07:09:50 -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 S1757247AbeFSOIk (ORCPT + 99 others); Tue, 19 Jun 2018 10:08:40 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:51136 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757216AbeFSOIi (ORCPT ); Tue, 19 Jun 2018 10:08:38 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 99CF980D; Tue, 19 Jun 2018 07:08:38 -0700 (PDT) Received: from e107981-ln.cambridge.arm.com (e107981-ln.cambridge.arm.com [10.1.207.54]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 851CE3F246; Tue, 19 Jun 2018 07:08:35 -0700 (PDT) Date: Tue, 19 Jun 2018 15:08:26 +0100 From: Lorenzo Pieralisi To: Punit Agrawal Cc: Michal Hocko , Xie XiuQi , Hanjun Guo , Bjorn Helgaas , tnowicki@caviumnetworks.com, linux-pci@vger.kernel.org, Catalin Marinas , "Rafael J. Wysocki" , Will Deacon , Linux Kernel Mailing List , Jarkko Sakkinen , linux-mm@kvack.org, wanghuiqiang@huawei.com, Greg Kroah-Hartman , Bjorn Helgaas , Andrew Morton , zhongjiang , linux-arm Subject: Re: [PATCH 1/2] arm64: avoid alloc memory on offline node Message-ID: <20180619140818.GA16927@e107981-ln.cambridge.arm.com> References: <20180611085237.GI13364@dhcp22.suse.cz> <16c4db2f-bc70-d0f2-fb38-341d9117ff66@huawei.com> <20180611134303.GC75679@bhelgaas-glaptop.roam.corp.google.com> <20180611145330.GO13364@dhcp22.suse.cz> <87lgbk59gs.fsf@e105922-lin.cambridge.arm.com> <87bmce60y3.fsf@e105922-lin.cambridge.arm.com> <8b715082-14d4-f10b-d2d6-b23be7e4bf7e@huawei.com> <20180619120714.GE13685@dhcp22.suse.cz> <874lhz3pmn.fsf@e105922-lin.cambridge.arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <874lhz3pmn.fsf@e105922-lin.cambridge.arm.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 19, 2018 at 01:52:16PM +0100, Punit Agrawal wrote: > Michal Hocko writes: > > > On Tue 19-06-18 20:03:07, Xie XiuQi wrote: > > [...] > >> I tested on a arm board with 128 cores 4 numa nodes, but I set CONFIG_NR_CPUS=72. > >> Then node 3 is not be created, because node 3 has no memory, and no cpu. > >> But some pci device may related to node 3, which be set in ACPI table. > > > > Could you double check that zonelists for node 3 are generated > > correctly? > > The cpus in node 3 aren't onlined and there's no memory attached - I > suspect that no zonelists are built for this node. > > We skip creating a node, if the number of SRAT entries parsed exceeds > NR_CPUS[0]. This in turn prevents onlining the numa node and so no > zonelists will be created for it. > > I think the problem will go away if the cpus are restricted via the > kernel command line by setting nr_cpus. > > Xie, can you try the below patch on top of the one enabling memoryless > nodes? I'm not sure this is the right solution but at least it'll > confirm the problem. This issue looks familiar (or at least related): git log d3bd058826aa The reason why the NR_CPUS guard is there is to avoid overflowing the early_node_cpu_hwid array. IA64 does something different in that respect compared to x86, we have to have a look into this. Regardless, AFAICS the proximity domains to nodes mappings should not depend on CONFIG_NR_CPUS, it seems that there is something wrong in that in ARM64 ACPI SRAT parsing. Lorenzo > > Thanks, > Punit > > [0] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm64/kernel/acpi_numa.c?h=v4.18-rc1#n73 > > -- >8 -- > diff --git a/arch/arm64/kernel/acpi_numa.c b/arch/arm64/kernel/acpi_numa.c > index d190a7b231bf..fea0f7164f1a 100644 > --- a/arch/arm64/kernel/acpi_numa.c > +++ b/arch/arm64/kernel/acpi_numa.c > @@ -70,11 +70,9 @@ void __init acpi_numa_gicc_affinity_init(struct acpi_srat_gicc_affinity *pa) > if (!(pa->flags & ACPI_SRAT_GICC_ENABLED)) > return; > > - if (cpus_in_srat >= NR_CPUS) { > + if (cpus_in_srat >= NR_CPUS) > pr_warn_once("SRAT: cpu_to_node_map[%d] is too small, may not be able to use all cpus\n", > NR_CPUS); > - return; > - } > > pxm = pa->proximity_domain; > node = acpi_map_pxm_to_node(pxm);