Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp1785113pxp; Mon, 7 Mar 2022 02:15:26 -0800 (PST) X-Google-Smtp-Source: ABdhPJzghfE9H1zb+SP6Ih6ja3kfVtKNMFvm5xyl2oFEPu3WdJzlkhHpb7SvGw7CWlXZED3TW4kR X-Received: by 2002:a17:906:7315:b0:6da:8210:9f88 with SMTP id di21-20020a170906731500b006da82109f88mr9025286ejc.301.1646648125863; Mon, 07 Mar 2022 02:15:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646648125; cv=none; d=google.com; s=arc-20160816; b=1KMLwT/GwspPkym6MpcYTL2+DX2VC1hBe3LVlS3t4AM1JS/e/UjgkG/uiMlx4i+Ouk d3s79GZdvB43tmAAjMV2CcetC771i10PJmLTBP0Hcg8xTEkwrD3Uy9Zy3kA8rCELCt3X +uELKRRgxYqHeF3j8P/40grhokFUuORUnMvllMA/as5ddFVz3eXR/tw50dWhYDXVXUO1 wYvGmKxaKaNF8dN/ZLlEMz7Rm9drd+wJw6T8uFN6HnmCyWpd7FtLekrsvlTY+H4wuwGj kxbgAGA+D//PoPEAj2JPMXLAIOI7EqEK+nYEX3LE90ZZi9HOSFalZjB9nEvK84NYLtYz zkUw== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=+kliuMoW7KCeQq1Vq0/BWpxIhjUlbf9EaFYeXbPidao=; b=R0Y/O6uUPGb5VsY5wOt7Qec6Ln0ZD7o0yqz2r10cYfQ5fJhJDyhCWv66DrHRFY5zss e6H8DDgZQCGXVQK+L2eThwu0NsuKhJ/XaeE7avYd4cZYfYiSQE6I5dC5DEqbWd8OHPzC Ral7eK6h5AqFdEsP51RSGf5tBAFCXsK5U7xiWHmAj448TPBSNMn6ag7efAYtwCp6Eft9 3hjKzR9f1F8k1J4NVV/w2NX0jHxu0k5ClEK0LECz20CH9aw59nHOAXdEmCMliTiqpNcX pDti+t206Io1c7qKdCceW3uEbZBuMpvgA9Yo66GIvbmtRlvtkBC5YNtkzoLJpaTOhghJ q4dw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=zXwsoP6h; 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=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dz10-20020a0564021d4a00b004163b0a91b8si2733056edb.393.2022.03.07.02.15.03; Mon, 07 Mar 2022 02:15:25 -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=@linuxfoundation.org header.s=korg header.b=zXwsoP6h; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238597AbiCGJsG (ORCPT + 99 others); Mon, 7 Mar 2022 04:48:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56990 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238221AbiCGJiF (ORCPT ); Mon, 7 Mar 2022 04:38:05 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C3E275F24A; Mon, 7 Mar 2022 01:32:15 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 4A916B810C0; Mon, 7 Mar 2022 09:32:14 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5F705C340E9; Mon, 7 Mar 2022 09:32:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1646645533; bh=yeY3QsvOJ99x6tgNWdp1LVI8EW8JKvXlZOMKcb58NGU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=zXwsoP6hNRaz6H7eOfRnu6n9joGIloRDC4Fk+yQqyFboSD4zzRfv3jImUBef2iYBT 3alytwYVORTahm+39o7/TO084g8ZPwKD9RyDpze1IKQrvDgkIOs1JeRjMVDtbLWCJ7 sQaC1wTKKgE7+CdaORDNaxFjdKaNUB7X+8QE6hP8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Valentin Schneider , John Paul Adrian Glaubitz , Sergei Trofimovich , "Peter Zijlstra (Intel)" , Ingo Molnar , Vincent Guittot , Dietmar Eggemann , Anatoly Pugachev , Andrew Morton , Linus Torvalds , dann frazier Subject: [PATCH 5.10 059/105] ia64: ensure proper NUMA distance and possible map initialization Date: Mon, 7 Mar 2022 10:19:02 +0100 Message-Id: <20220307091645.841162839@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220307091644.179885033@linuxfoundation.org> References: <20220307091644.179885033@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, 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 Signed-off-by: dann frazier Signed-off-by: Greg Kroah-Hartman --- arch/ia64/kernel/acpi.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) --- a/arch/ia64/kernel/acpi.c +++ b/arch/ia64/kernel/acpi.c @@ -446,7 +446,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; } /* @@ -489,7 +490,7 @@ void __init acpi_numa_fixup(void) for (j = 0; j < MAX_NUMNODES; j++) slit_distance(i, j) = i == j ? LOCAL_DISTANCE : REMOTE_DISTANCE; - return; + goto out; } memset(numa_slit, -1, sizeof(numa_slit)); @@ -514,6 +515,8 @@ void __init acpi_numa_fixup(void) printk("\n"); } #endif +out: + node_possible_map = node_online_map; } #endif /* CONFIG_ACPI_NUMA */