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=-5.5 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no 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 AD495C433E1 for ; Mon, 20 Jul 2020 02:04:06 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 791052177B for ; Mon, 20 Jul 2020 02:04:06 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 791052177B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=huawei.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 147106B0005; Sun, 19 Jul 2020 22:04:06 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 0D0746B0006; Sun, 19 Jul 2020 22:04:06 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id ED9C66B0007; Sun, 19 Jul 2020 22:04:05 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0056.hostedemail.com [216.40.44.56]) by kanga.kvack.org (Postfix) with ESMTP id D73756B0005 for ; Sun, 19 Jul 2020 22:04:05 -0400 (EDT) Received: from smtpin07.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 9010C1831E40F for ; Mon, 20 Jul 2020 02:04:05 +0000 (UTC) X-FDA: 77056808850.07.pain23_5006e5f26f21 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin07.hostedemail.com (Postfix) with ESMTP id 5D239183EC330 for ; Mon, 20 Jul 2020 02:02:57 +0000 (UTC) X-HE-Tag: pain23_5006e5f26f21 X-Filterd-Recvd-Size: 4372 Received: from huawei.com (szxga07-in.huawei.com [45.249.212.35]) by imf26.hostedemail.com (Postfix) with ESMTP for ; Mon, 20 Jul 2020 02:02:56 +0000 (UTC) Received: from DGGEMS414-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id C24A7AB957D3D94B7215; Mon, 20 Jul 2020 10:02:53 +0800 (CST) Received: from [127.0.0.1] (10.174.179.33) by DGGEMS414-HUB.china.huawei.com (10.3.19.214) with Microsoft SMTP Server id 14.3.487.0; Mon, 20 Jul 2020 10:02:43 +0800 Subject: Re: [PATCH v2 0/6] ACPI: Only create NUMA nodes from entries in SRAT or SRAT emulation. To: Jonathan Cameron , , , , CC: Lorenzo Pieralisi , Bjorn Helgaas , , , "Ingo Molnar" , , Tony Luck , Fenghua Yu , Thomas Gleixner , , Dan Williams , Song Bao Hua References: <20200717175959.899775-1-Jonathan.Cameron@huawei.com> From: Hanjun Guo Message-ID: <9b679614-083b-cec4-e0de-34e1a66b103a@huawei.com> Date: Mon, 20 Jul 2020 10:02:42 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: <20200717175959.899775-1-Jonathan.Cameron@huawei.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit X-Originating-IP: [10.174.179.33] X-CFilter-Loop: Reflected X-Rspamd-Queue-Id: 5D239183EC330 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam04 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 2020/7/18 1:59, Jonathan Cameron wrote: > Here, I will use the term Proximity Domains for the ACPI description and > NUMA Nodes for the in kernel representation. > > ACPI 6.3 included a clarification that only Static Resource Allocation > Structures in SRAT may define the existence of proximity domains > (sec 5.2.16). This clarification closed a possible interpretation that > other parts of ACPI (e.g. DSDT _PXM, NFIT etc) could define new proximity > domains that were not also mentioned in SRAT structures. > > In practice the kernel has never allowed this alternative interpretation as > such nodes are only partially initialized. This is architecture specific > but to take an example, on x86 alloc_node_data has not been called. > Any use of them for node specific allocation, will result in a crash as the > infrastructure to fallback to a node with memory is not setup. > > We ran into a problem when enabling _PXM handling for PCI devices and found > there were boards out there advertising devices in proximity domains that > didn't exist [2]. > > The fix suggested in this series is to replace instances that should not > 'create' new nodes with pxm_to_node. This function needs a some additional > hardening against invalid inputs to make sure it is safe for use in these > new callers. > > Patch 1 Hardens pxm_to_node() against numa_off, and pxm entry being too large. > > Patch 2-4 change the various callers not related to SRAT entries so that they > set this parameter to false, so do not attempt to initialize a new NUMA node > if the relevant one does not already exist. > > Patch 5 is a function rename to reflect change in functionality of > acpi_map_pxm_to_online_node() as it no longer creates a new map, but just does a > lookup of existing maps. > > Patch 6 covers the one place we do not allow the full flexibility defined > in the ACPI spec. For SRAT GIC Interrupt Translation Service (ITS) Affinity > Structures, on ARM64, the driver currently makes an additional pass of SRAT > later in the boot than the one used to identify NUMA domains. > Note, this currently means that an ITS placed in a proximity domain that is > not defined by another SRAT structure will result in the a crash. > > To avoid this crash with minimal changes we do not create new NUMA nodes based > on this particular entry type. Any current platform trying to do this will not > boot, so this is an improvement, if perhaps not a perfect solution. Make sense to me, Reviewed-by: Hanjun Guo