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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 167F4C433EF for ; Mon, 7 Mar 2022 20:01:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245254AbiCGUCR (ORCPT ); Mon, 7 Mar 2022 15:02:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34588 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236183AbiCGUCO (ORCPT ); Mon, 7 Mar 2022 15:02:14 -0500 Received: from smtp-relay-internal-1.canonical.com (smtp-relay-internal-1.canonical.com [185.125.188.123]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 766D58A6DC for ; Mon, 7 Mar 2022 12:01:19 -0800 (PST) Received: from mail-il1-f200.google.com (mail-il1-f200.google.com [209.85.166.200]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-1.canonical.com (Postfix) with ESMTPS id D575C3F7DE for ; Mon, 7 Mar 2022 20:01:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1646683277; bh=MYa3HOnxdRf4zgP873BwgLR5fhhIJBKgyitcscinRGs=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=iKcSvaTX5CezgRFwv9CXSk4lj8kJImaIxunT+dxJmlePwWO5irFdEpM4svRRuw0+g iLUXgTjAfK+I/xXr+QToAkzCcKg2uTG7AO7hVTDLK/eReP1DYbvVmW0MaKxmP2/nwY EAGLLXwwKO2Rtm53791dH22qCDnUyMzzKSmOIS77BZN8ExyggUFQqiMWTVF7gELLy0 N1V5T7+IqaD8yjS1S52cwWeJkb9WIKKRwG9N9523e75tQiZv2NiBZViC9Ab0cWzhZ1 MEPt9WJGXsybniRTb3ePxmbX1kB3uyqyH1SiFATpwK4el/yQowPZmdg5v8QSoIHr3H xJau3zRLRjbxQ== Received: by mail-il1-f200.google.com with SMTP id m17-20020a923f11000000b002c10e8f4c44so11056197ila.1 for ; Mon, 07 Mar 2022 12:01:17 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=MYa3HOnxdRf4zgP873BwgLR5fhhIJBKgyitcscinRGs=; b=XVI8fb+EUjFI5bZFStz4g+/Y0SGPewexf5+4kPy0nVjpYpeIUVFAB+NQ3dLbt7RXdB rTAs/j3FyWzkc2gjc5pRUYTuKIPqUOZANd7ZYXNoN/6dPw5UpnH7mY+G2FqNMEsvt+8B 2JLCjAZSZrQdPBNTHj/2yGGbBvltd5Y7lADfn3xDV/BeJQSvUJjLRb8HBtv+Pa/AGZF2 kGSyfDpF2+RBDxgrQZuDQRfAjsoqmCAKTLDJqqgGJgjbh3Jn2OBYVh2E6WzrDmu2mSMJ bp9DEO/XlccRJMVnw8F2Nu5Ej+tNLq8KcHBlhzee0NAHasVVbl3/mV5AvoVA1n/78ipo p2iA== X-Gm-Message-State: AOAM531pd7M5AgME8lLopg9il7DCrBRAPWXm2R6I5gtag21Y0o2fMDnz QJFHYV1B8MMdnZJt9Z1RrGRudhb1Yu7Zyw7OGjWtgl4aymltjpW6wJIC1huq65UfAnz2IV8ffEC BAFNTbVFnQUWw1Melb6T+jxOzq9lwgNiYu27MrpFOnA== X-Received: by 2002:a05:6e02:12c8:b0:2c6:343f:b38d with SMTP id i8-20020a056e0212c800b002c6343fb38dmr9044941ilm.191.1646683276042; Mon, 07 Mar 2022 12:01:16 -0800 (PST) X-Google-Smtp-Source: ABdhPJy96vcAbo82iuBKo9tD9gfr0H6HRXTec4IyY9lWSXwZ/FMfpgnRmWgQl1B4puiYokwT6kHEiA== X-Received: by 2002:a05:6e02:12c8:b0:2c6:343f:b38d with SMTP id i8-20020a056e0212c800b002c6343fb38dmr9044912ilm.191.1646683275731; Mon, 07 Mar 2022 12:01:15 -0800 (PST) Received: from localhost (c-71-196-238-11.hsd1.co.comcast.net. [71.196.238.11]) by smtp.gmail.com with ESMTPSA id q4-20020a056e0215c400b002c5fdff3087sm12302924ilu.29.2022.03.07.12.01.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Mar 2022 12:01:14 -0800 (PST) From: dann frazier To: stable@vger.kernel.org Cc: Valentin Schneider , Dietmar Eggemann , Peter Zijlstra , Ingo Molnar , Vincent Guittot , John Paul Adrian Glaubitz , Sergei Trofimovich , Anatoly Pugachev , Andrew Morton , Linus Torvalds , linux-kernel@vger.kernel.org Subject: [PATCH 4.19 3/3] ia64: ensure proper NUMA distance and possible map initialization Date: Mon, 7 Mar 2022 13:01:09 -0700 Message-Id: <20220307200109.459214-1-dann.frazier@canonical.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220307195941.459076-1-dann.frazier@canonical.com> References: <20220307195941.459076-1-dann.frazier@canonical.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Valentin Schneider commit b22a8f7b4bde4e4ab73b64908ffd5d90ecdcdbfd upstream. John Paul reported a warning about bogus NUMA distance values spurred by commit: 620a6dc40754 ("sched/topology: Make sched_init_numa() use a set for the deduplicating sort") In this case, the afflicted machine comes up with a reported 256 possible nodes, all of which are 0 distance away from one another. This was previously silently ignored, but is now caught by the aforementioned commit. The culprit is ia64's node_possible_map which remains unchanged from its initialization value of NODE_MASK_ALL. In John's case, the machine doesn't have any SRAT nor SLIT table, but AIUI the possible map remains untouched regardless of what ACPI tables end up being parsed. Thus, !online && possible nodes remain with a bogus distance of 0 (distances \in [0, 9] are "reserved and have no meaning" as per the ACPI spec). Follow x86 / drivers/base/arch_numa's example and set the possible map to the parsed map, which in this case seems to be the online map. Link: http://lore.kernel.org/r/255d6b5d-194e-eb0e-ecdd-97477a534441@physik.fu-berlin.de Link: https://lkml.kernel.org/r/20210318130617.896309-1-valentin.schneider@arm.com Fixes: 620a6dc40754 ("sched/topology: Make sched_init_numa() use a set for the deduplicating sort") Signed-off-by: Valentin Schneider Reported-by: John Paul Adrian Glaubitz Tested-by: John Paul Adrian Glaubitz Tested-by: Sergei Trofimovich Cc: "Peter Zijlstra (Intel)" Cc: Ingo Molnar Cc: Vincent Guittot Cc: Dietmar Eggemann Cc: Anatoly Pugachev Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds [ dannf: minor context adjustment in arch/ia64/kernel/acpi.c ] Signed-off-by: dann frazier --- arch/ia64/kernel/acpi.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/arch/ia64/kernel/acpi.c b/arch/ia64/kernel/acpi.c index 1dacbf5e9e09..3856894e86b8 100644 --- a/arch/ia64/kernel/acpi.c +++ b/arch/ia64/kernel/acpi.c @@ -537,7 +537,8 @@ void __init acpi_numa_fixup(void) if (srat_num_cpus == 0) { node_set_online(0); node_cpuid[0].phys_id = hard_smp_processor_id(); - return; + slit_distance(0, 0) = LOCAL_DISTANCE; + goto out; } /* @@ -580,7 +581,7 @@ void __init acpi_numa_fixup(void) for (j = 0; j < MAX_NUMNODES; j++) node_distance(i, j) = i == j ? LOCAL_DISTANCE : REMOTE_DISTANCE; - return; + goto out; } memset(numa_slit, -1, sizeof(numa_slit)); @@ -605,6 +606,8 @@ void __init acpi_numa_fixup(void) printk("\n"); } #endif +out: + node_possible_map = node_online_map; } #endif /* CONFIG_ACPI_NUMA */ -- 2.25.1