From patchwork Wed May 11 17:17:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Lemon X-Patchwork-Id: 571541 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5082EC433F5 for ; Wed, 11 May 2022 17:24:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237585AbiEKRYm (ORCPT ); Wed, 11 May 2022 13:24:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48750 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345517AbiEKRYl (ORCPT ); Wed, 11 May 2022 13:24:41 -0400 X-Greylist: delayed 401 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Wed, 11 May 2022 10:24:38 PDT Received: from smtp1.emailarray.com (smtp1.emailarray.com [65.39.216.14]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 85AA722B3A4 for ; Wed, 11 May 2022 10:24:38 -0700 (PDT) Received: (qmail 67552 invoked by uid 89); 11 May 2022 17:17:56 -0000 Received: from unknown (HELO localhost) (amxlbW9uQGZsdWdzdmFtcC5jb21AMTYzLjExNC4xMzIuNQ==) (POLARISLOCAL) by smtp1.emailarray.com with SMTP; 11 May 2022 17:17:56 -0000 Date: Wed, 11 May 2022 10:17:54 -0700 From: Jonathan Lemon To: "Rafael J. Wysocki" , Jonathan Cameron Cc: Hanjun Guo , Barry Song , Len Brown , Jakub Kicinski , linux-acpi@vger.kernel.org, kernel-team@fb.com Subject: [PATCH]: Revert "ACPI: Remove side effect of partly creating a node in acpi_get_node()" Message-ID: <20220511171754.avfrrqg6eihku55s@bsd-mbp.dhcp.thefacebook.com> MIME-Version: 1.0 Content-Disposition: inline Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org This reverts commit a62d07e0006a3a3ce77041ca07f3c488ec880790. The change calls pxm_to_node(), which ends up returning -1 (NUMA_NO_NODE) on some systems for the pci bus, as opposed to the prior call to acpi_map_pxm_to_node(), which returns 0. The default numa node is then inherited by all pci devices, and is visible in /sys/bus/pci/devices/*/numa_node The prior behavior shows: # cat /sys/bus/pci/devices/*/numa_node | sort | uniq -c 122 0 While the new behavior has: # cat /sys/bus/pci/devices/*/numa_node | sort | uniq -c 1 0 121 -1 While arguably NUMA_NO_NODE is correct on single-socket systems which have only one numa domain, this breaks scripts that attempt to read the NIC numa_node and pass that to numactl in order to pin memory allocation when running applications (like iperf). E.g.: # numactl -p -1 iperf3 libnuma: Warning: node argument -1 is out of range <-1> is invalid Reverting this change restores the prior behavior. Signed-off-by: Jonathan Lemon --- drivers/acpi/numa/srat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/acpi/numa/srat.c b/drivers/acpi/numa/srat.c index 3b818ab186be..f150c5c1d0a8 100644 --- a/drivers/acpi/numa/srat.c +++ b/drivers/acpi/numa/srat.c @@ -564,6 +564,6 @@ int acpi_get_node(acpi_handle handle) pxm = acpi_get_pxm(handle); - return pxm_to_node(pxm); + return acpi_map_pxm_to_node(pxm); } EXPORT_SYMBOL(acpi_get_node);