Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp511387pxf; Thu, 18 Mar 2021 06:09:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw3pjDl6haiD3bMGPPpTfj97xnncv+BGMudsvJ45Q+3Q28BUkKIUVF55u9EaPvyPkx6zkwm X-Received: by 2002:a05:6402:cb8:: with SMTP id cn24mr3601087edb.105.1616072982189; Thu, 18 Mar 2021 06:09:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616072982; cv=none; d=google.com; s=arc-20160816; b=mujzU4z1gvIQbyIjLbRiiRBvB50Veode2G3j03tv6hoixMJ7nnwEZh5z4mzwV0T0XY fHKmlHCqf9CDqUXAOX5Ec6pQLK153nSiuFjJ/7nm/dIXIXpF4LsTJ7lFFus8UAgwuNYr aE5LA4yxlI5XvOsMZP/SdyH+pfVn+CQApk/FJuzMYNXMFMTnZ0JEwDlYLK2d3BYAdxbF 08VE7P+hfwRPg4+Y2xpoe2CmDCFb8/922wAXY2F8Fg6XxcAClectcOXYxcZML8vymdhy 78te/ChMneNB4VvESHvdITkh58y754bEqZV+ySHW84SoxVPcKDZzymCPWeUxrhMnkohU 7nEQ== 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 :message-id:date:subject:cc:to:from; bh=nJJfQxUxjBbEzj27sCrYfBppMkQRm2w6CqKCW7J6Ctc=; b=OWxlGjZW8H9W6llb14YEURkZt9Ojfo+BXw5ka8msRda9dhcSg6F6Gi/VMh7MZW42bQ jpyKkKeQLKSvka04ObhxuRLAc7rfobJu68+BGJgZRwkoZ5YZu8BTH/6gKolMgFaVFt4Q ws9m/F/zAs7GwInLPuIRoBLZD1bFZ2Jo6ns6AmSm1NvgBMZWmv3nsxdCVHahhONdvb2g ZjGM2TPUsTOAeYglS6ePE/tNfkuw1HCe2veA9kWKPRkL2TxSpd/uDUg5i3GXcP6H6nbY DDUaBwfOPwD+6AvN3xEhB9kqqnQnaVPZzWSCHlEwn3imYJbaCfAJESr1CIxwfkza1Esh S76Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f21si1453616edy.337.2021.03.18.06.09.14; Thu, 18 Mar 2021 06:09:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230506AbhCRNIR (ORCPT + 99 others); Thu, 18 Mar 2021 09:08:17 -0400 Received: from foss.arm.com ([217.140.110.172]:40610 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231244AbhCRNH6 (ORCPT ); Thu, 18 Mar 2021 09:07:58 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id D1206ED1; Thu, 18 Mar 2021 06:07:57 -0700 (PDT) Received: from e113632-lin.cambridge.arm.com (e113632-lin.cambridge.arm.com [10.1.194.46]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 5B9553F718; Thu, 18 Mar 2021 06:07:56 -0700 (PDT) From: Valentin Schneider To: linux-kernel@vger.kernel.org, "linux-ia64@vger.kernel.org" , debian-ia64 Cc: John Paul Adrian Glaubitz , "Peter Zijlstra (Intel)" , Ingo Molnar , Vincent Guittot , Dietmar Eggemann , Sergei Trofimovich , Anatoly Pugachev Subject: [PATCH] ia64: Ensure proper NUMA distance and possible map initialization Date: Thu, 18 Mar 2021 13:06:17 +0000 Message-Id: <20210318130617.896309-1-valentin.schneider@arm.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Fixes: 620a6dc40754 ("sched/topology: Make sched_init_numa() use a set for the deduplicating sort") Reported-by: John Paul Adrian Glaubitz Signed-off-by: Valentin Schneider --- This might need an earlier Fixes: tag, but all of this is quite old and dusty (the git blame rabbit hole leads me to ~2008/2007) Alternatively, can we deprecate ia64 already? --- 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 a5636524af76..e2af6b172200 100644 --- 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 */ -- 2.25.1