Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp2311931pxp; Mon, 7 Mar 2022 12:37:53 -0800 (PST) X-Google-Smtp-Source: ABdhPJzm1HS/IckQjVozlrzCA+UjEwtRkLDIjbhK0NCny6z59BxfHZQ5gPA/U68wT8L2KCxz0BQ8 X-Received: by 2002:a17:906:c114:b0:6d7:1065:a8b0 with SMTP id do20-20020a170906c11400b006d71065a8b0mr10432712ejc.181.1646685472611; Mon, 07 Mar 2022 12:37:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646685472; cv=none; d=google.com; s=arc-20160816; b=XasVU/bHcA/j/nB95jXe/ea2zTvuG3hdvZT5nYu9XHeg6OgoAxTmN2o+3DA0OwY/mX kb1tTFDG9Fb2DNMElDxRkQMuD3xMc151qFpcMh3avIx5M5yuwlDWogixJHHClSgbFpj0 a9yTZGMrNub3sz+hk+/Vlnny0gLoeoULhNdw1V9K7A72TiQfHFfnoXpI6652QnC331Pd XABDl7D2xza2wRLjtqHzWObp54VUF7yksYm05nsEcBGChWMwTXo4ny6KPUPtTv6hrKfq yqg8UiRh9pKMUuLZVHtpUgzVRqUL/IePYf8Ur4U9+Ax02/DZmp89r6sOC0SN3Tw46svE DAqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=MYa3HOnxdRf4zgP873BwgLR5fhhIJBKgyitcscinRGs=; b=VtdiXgD6SbcuLXm4ZRegp3QFKn7T4GPc01ksZGE+rYiHrcWBr5CBsI9ceBU7iUGTbD eb0xAkHHUmm+eHGcYcfnmUX5/b8eg9pOEWar5+RX0pYrEv1W2eO7DXdmkOvrCr+a1rCe rLUI97ugVE+Qr6O6TbOh9tmYdiPHn3QAhqehjK8gck/xuHXY4Bt//KXJ8fRijIAAxrY9 Vb5baa6bPPdQXiGgAZlqqR+UMgXsPoMhJ0rTdYqeWmHrj5vp/dhBRmXce1o1+L6qR3B3 +q1zP8X0xdDxAPgFkCtDPXVDI1dORNPynePjYSSSETfRR+HSS3mDPR2P4u3otS4pRSKY c3mw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@canonical.com header.s=20210705 header.b=iKcSvaTX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=canonical.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z1-20020a50eb41000000b00410a2e77995si9997703edp.15.2022.03.07.12.37.29; Mon, 07 Mar 2022 12:37:52 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@canonical.com header.s=20210705 header.b=iKcSvaTX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=canonical.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245250AbiCGUCQ (ORCPT + 99 others); Mon, 7 Mar 2022 15:02:16 -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-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 X-Spam-Status: No, score=-4.9 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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