Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp5277314imm; Tue, 19 Jun 2018 07:55:23 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIE4L151KlwN8c9RH9RSX+TbiuDUoVC+QcVk8oWIe7k0cBshuEPNg56f7P3Hd3EyRnu+Xc8 X-Received: by 2002:a62:ecdb:: with SMTP id e88-v6mr18724086pfm.16.1529420123131; Tue, 19 Jun 2018 07:55:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529420123; cv=none; d=google.com; s=arc-20160816; b=XqQwIsM0PGg+Vsxboi6tD3TrLjc6nM00ZFYJMzMePkt8jCDejA471CS2qaQCYS4Qxx V0187KYVRNt0A/0JooTFUfOPdar8Ae8hJhqdnQHG7kWnQh7q2Y3xbRwKhjxO/eslohJ6 Yb8DBzM6uw+b7VtppDmEUWmxrymQHl25AyxrU+2aHyfxZA+X19kGqGSDSVUjahFlnBew 88pfcQPtjp4tOM+vQGwe5ie3NG8jinM5BIfyBs6BdfmWMqbqSeIuQ87OTTpIYT4GmnQY skOP4cf9ZbuwOaSvHefneSHG7hVbxlYJnnt6n7fOu/3SxVWeWt8M/xwLcIkuibJfeM9q EatA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from :arc-authentication-results; bh=JctTFuCSmvdV0IDwrhXI794vBn9upflrXWWVjWmjR3Y=; b=IlalLa1nxgFKp4YsYrk1upmQsMp6qRoZWYL6rJQK/sofqq+o6fPdzeNU2xOn5C/66M ion5tEyb8WyMYW/QtHG106d/gCHBmfHCDMXoOpgJrqUugO0lk3AfnWzseMYGN/WBNB4Q dInn0Qm805L8IKjXpOt2adDCaKaoN919tFK0CVb+1zPKRdIJYs2f06Lf6Xv+k5TiYCV8 XVZbKexUQpMtyF2g4aeRsR2cq21/12lOErz/Z28e0FD2lyjXZ9Atuf3rbcIUBdZ2TI8A JPpauvzexIy4Ymf2unZNpJg6DBDOg16xrkQOlw5h5P+xWRZq8zFzS/iXLOEn+aPSphhH Y05Q== 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 p76-v6si17652503pfk.275.2018.06.19.07.55.08; Tue, 19 Jun 2018 07:55:23 -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 S937668AbeFSOy3 (ORCPT + 99 others); Tue, 19 Jun 2018 10:54:29 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:51768 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756852AbeFSOy2 (ORCPT ); Tue, 19 Jun 2018 10:54:28 -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 2D8B780D; Tue, 19 Jun 2018 07:54:28 -0700 (PDT) Received: from localhost (e105922-lin.cambridge.arm.com [10.1.206.33]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id C304F3F557; Tue, 19 Jun 2018 07:54:27 -0700 (PDT) From: Punit Agrawal To: Lorenzo Pieralisi Cc: Michal Hocko , Xie XiuQi , Hanjun Guo , Bjorn Helgaas , , , Catalin Marinas , "Rafael J. Wysocki" , Will Deacon , Linux Kernel Mailing List , Jarkko Sakkinen , , , Greg Kroah-Hartman , Bjorn Helgaas , Andrew Morton , zhongjiang , linux-arm Subject: Re: [PATCH 1/2] arm64: avoid alloc memory on offline node 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> <20180619140818.GA16927@e107981-ln.cambridge.arm.com> Date: Tue, 19 Jun 2018 15:54:26 +0100 In-Reply-To: <20180619140818.GA16927@e107981-ln.cambridge.arm.com> (Lorenzo Pieralisi's message of "Tue, 19 Jun 2018 15:08:26 +0100") Message-ID: <87wouu3jz1.fsf@e105922-lin.cambridge.arm.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Lorenzo Pieralisi writes: > 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 Indeed. Thanks for digging into this. > > The reason why the NR_CPUS guard is there is to avoid overflowing > the early_node_cpu_hwid array. Ah right... I missed that. The below patch is definitely not what we want. > 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. Not only SRAT parsing but it looks like there is a similar restriction while parsing the ACPI MADT in acpi_map_gic_cpu_interface(). The incomplete parsing introduces a dependency on the ordering of entries being aligned between SRAT and MADT when NR_CPUS is restricted. We want to parse the entire table in both cases so that the code is robust to reordering of entries. In terms of $SUBJECT, I wonder if it's worth taking the original patch as a temporary fix (it'll also be easier to backport) while we work on fixing these other issues and enabling memoryless nodes.