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=-4.0 required=3.0 tests=BAYES_00,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 5002DC4363D for ; Thu, 24 Sep 2020 11:03:51 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id A976E2395B for ; Thu, 24 Sep 2020 11:03:50 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A976E2395B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 0B53F6B00AE; Thu, 24 Sep 2020 07:03:50 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 065EA6B00AF; Thu, 24 Sep 2020 07:03:50 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E96BF6B00B0; Thu, 24 Sep 2020 07:03:49 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0080.hostedemail.com [216.40.44.80]) by kanga.kvack.org (Postfix) with ESMTP id D24A66B00AE for ; Thu, 24 Sep 2020 07:03:49 -0400 (EDT) Received: from smtpin30.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 995488249980 for ; Thu, 24 Sep 2020 11:03:49 +0000 (UTC) X-FDA: 77297669778.30.jam65_550f2de2715e Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin30.hostedemail.com (Postfix) with ESMTP id 6D607180B3C85 for ; Thu, 24 Sep 2020 11:03:49 +0000 (UTC) X-HE-Tag: jam65_550f2de2715e X-Filterd-Recvd-Size: 8868 Received: from mail-oi1-f195.google.com (mail-oi1-f195.google.com [209.85.167.195]) by imf31.hostedemail.com (Postfix) with ESMTP for ; Thu, 24 Sep 2020 11:03:48 +0000 (UTC) Received: by mail-oi1-f195.google.com with SMTP id m7so3258782oie.0 for ; Thu, 24 Sep 2020 04:03:48 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=pn+i27Dx8fEtrGXxMazmn/X4tGbmkIv7rNYd8W3GRss=; b=cwZEOEdg6RLzz9MJMsccHF6C9h0udv+ScBLhrHBJx3IdzQW0cTJcCQQUmB5PVdHqQW NYnkmu+csGYjzqUhCd9QfshQv1fc3KC3xMovZqkxTI0RkBd8gJEN2RGx2biXM478Ko11 l8goR1THtc/975CujehB/pZgLY0qi/kEJF0sz6EHt1cv0bcmlgIhilrGNYw4fO/UEQ9e jySgenC8k+D2fMCQhy4gyUfnt+oyURF5mFdYGmT54yyvRsYwpuBytuI+TV8sRkNWkF3O a9xpMymIM60tmU1jFkYGanHmP+uQGUO15qEbJG726N7Kt2inlyoT6uCj/zgEvaz5Z+Rc aAwQ== X-Gm-Message-State: AOAM532Gvh4vD8dBJIBxBJUjDkWKZ+OuQTI/p1GD45LXfn+x5EPCh+JW IB+oMKN0/pMrUDB5qq+wva9UqjXfatgD/iYCmPM= X-Google-Smtp-Source: ABdhPJzDlpEJUA+Oq7l4adHVs9utovmT1K6AS39uuXbGtk7ZnfPxF0dnzHWkg5WoiVh0kzqj9RfrHNDZVceiVU+YuOc= X-Received: by 2002:aca:df84:: with SMTP id w126mr2207061oig.103.1600945428210; Thu, 24 Sep 2020 04:03:48 -0700 (PDT) MIME-Version: 1.0 References: <20200818142430.1156547-1-Jonathan.Cameron@huawei.com> <20200903133318.000017f5@Huawei.com> <20200918131427.0000080f@Huawei.com> In-Reply-To: <20200918131427.0000080f@Huawei.com> From: "Rafael J. Wysocki" Date: Thu, 24 Sep 2020 13:03:37 +0200 Message-ID: Subject: Re: [PATCH v3 0/6] ACPI: Only create NUMA nodes from entries in SRAT or SRAT emulation. To: Jonathan Cameron Cc: Linux Memory Management List , ACPI Devel Maling List , Linux ARM , "the arch/x86 maintainers" , "Rafael J. Wysocki" , Fenghua Yu , Lorenzo Pieralisi , linux-ia64@vger.kernel.org, Tony Luck , Linux PCI , Linuxarm , Ingo Molnar , martin@geanix.com, Bjorn Helgaas , Thomas Gleixner , Dan Williams Content-Type: text/plain; charset="UTF-8" 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 Fri, Sep 18, 2020 at 2:16 PM Jonathan Cameron wrote: > > On Thu, 3 Sep 2020 13:33:18 +0100 > Jonathan Cameron wrote: > > > On Tue, 18 Aug 2020 22:24:24 +0800 > > Jonathan Cameron wrote: > > > > > This is a trivial rebase and resend of V2 now the merge window has closed. > > > > > > 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. > > > > > > [1] Note in ACPI Specification 6.3 5.2.16 System Resource Affinity Table (SRAT) > > > [2] https://patchwork.kernel.org/patch/10597777/ > > > > Looking for input from ARM (Lorenzo?), X86(not sure) and ACPI(Rafael?) people > > on this set. As it also touches NFIT handling perhaps someone who focuses on > > that as well. Please feel free to CC additional people who might be interested. > > > > I'm fairly confident that it should be uncontroversial (famous last words) > > and it closes down a problem that lead to issues with seemingly obvious > > changes in the past. (The whole PCI _PXM issue on some threadripper platforms). > > > > Thanks to Bjorn, Hanjun and Barry for feedback on earlier revisions. > > > > Hi All, > > Still after reviews on this set. If anyone one would like me to resend please > let me know. Also any corrections to my suggested set of people to review would > be welcome. > > +CC Rafael who I've managed to drop from this version which won't have helped. Thanks! I've just applied the series for 5.10 (with some minor edits in patch changelogs and subjects), so if anyone has any reservations regarding it, please let me know ASAP. In particular, I took the Hanjun's R-by on the last patch to be sufficient from the ARM64 perspective. Cheers! > > > Thanks to Bjorn Helgaas for review of v1 and Barry Song for internal reviews that > > > lead to a slightly different approach for this v2. > > > > > > Changes since v2. > > > * Trivial rebase to v5.9-rc1 > > > * Collect up tags. > > > > > > Changes since v1. > > > * Use pxm_to_node for what was previously the path using acpi_map_pxm_to_node > > > with create==false. (Barry) > > > * Broke patch up into an initial noop stage followed by patches (Bjorn) > > > to update each type of case in which partial creation of NUMA nodes is prevented. > > > * Added patch 5 to rename function to reflect change of functionality. > > > * Updated descriptions (now mostly in individual patches) inline with Bjorn's comments. > > > > > > Jonathan Cameron (6): > > > ACPI: Add out of bounds and numa_off protections to pxm_to_node > > > ACPI: Do not create new NUMA domains from ACPI static tables that are > > > not SRAT > > > ACPI: Remove side effect of partly creating a node in > > > acpi_map_pxm_to_online_node > > > ACPI: Rename acpi_map_pxm_to_online_node to pxm_to_online_node > > > ACPI: Remove side effect of partly creating a node in acpi_get_node > > > irq-chip/gic-v3-its: Fix crash if ITS is in a proximity domain without > > > processor or memory > > > > > > drivers/acpi/arm64/iort.c | 2 +- > > > drivers/acpi/nfit/core.c | 6 ++---- > > > drivers/acpi/numa/hmat.c | 4 ++-- > > > drivers/acpi/numa/srat.c | 4 ++-- > > > drivers/iommu/intel/dmar.c | 2 +- > > > drivers/irqchip/irq-gic-v3-its.c | 7 ++++++- > > > include/linux/acpi.h | 15 +++++++-------- > > > 7 files changed, 21 insertions(+), 19 deletions(-) > > > > > > > > > _______________________________________________ > > Linuxarm mailing list > > Linuxarm@huawei.com > > http://hulk.huawei.com/mailman/listinfo/linuxarm > >