Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp2299442pxp; Mon, 21 Mar 2022 16:15:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwJWCQouGx8xs7So3SCgCf7GJu38/e6HXE2gFf5g+yTg1N318VDcURHydRNZFB2zwlW2oki X-Received: by 2002:a63:4382:0:b0:383:38ae:bb23 with SMTP id q124-20020a634382000000b0038338aebb23mr1067111pga.148.1647904556372; Mon, 21 Mar 2022 16:15:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647904556; cv=none; d=google.com; s=arc-20160816; b=yT4VDTKD/1nxzSFiLgZvMZNnsny0yp+ZDLdGSihsa+NR0NUYxHMT9aSsz8TXR9cZQx /8bVLvhO40mF5nyq8SG4FQDxREyuVZHVPZ2f07TCWEzvPw7IoDEFGkrPs+Ln7WenfHqQ Jwgrgrmv++79Hp1i5B+VmHj79kv9GBWJzAPBWTu9vM/IGoOqXd6Rvevlb7vaEuUhPaOG 4nplryUGP8DgED3H2PX1hSTFSncsud/dQ6uG1n7li8G1P8q8CHOlLFFnejggvCXkWeLR DFm3pMiGyqfjqa7vstMA74GWyO7+h9HD83Hf0nvGMFXjJ4jtR6yfgrRUrQaQS8Cs7ErK rO2g== 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=mcbl8tsS9cxfz34gTq4WM5e9lE0ntnm9CacQ1Cn7uno=; b=rhulZeCzbXvqZ/v94Tf2LfKTj/l5/0x9XFPizB5Wa1wRwBYvzkWCdUD9Bmott8gjs4 WVCOBh83bD3CV5OD9jrSgKttb+QKTA7TyufJB1+fBWftMIzZXxNe3AigfJaJLwEbyHez QpOdI5SJE/L9KYkY+c/l9hOB2Hm0nVtI0ewUCvRj5jM119KFXNSpe90kpoD+zp5zn9eH Qo68/jPt2Xl+jvHMl78VD9itLfU0oOffD1mURzBlDrX+fkpVhtGTdQYjp4lOZtNyUD8C jkMgFW9Q8MbJFfIS5PxVyVpEnvCy28sQ70hghCSjhGwWXeYZqEGyK2t/TNJtm+l+Isfw Sm8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=rdrxHT7C; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id f22-20020a656296000000b003816043f12fsi14152820pgv.804.2022.03.21.16.15.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Mar 2022 16:15:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=rdrxHT7C; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 897D7447D9B; Mon, 21 Mar 2022 15:13:50 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348461AbiCUOAW (ORCPT + 99 others); Mon, 21 Mar 2022 10:00:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43988 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348391AbiCUN5m (ORCPT ); Mon, 21 Mar 2022 09:57:42 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 734F1177094; Mon, 21 Mar 2022 06:55:25 -0700 (PDT) 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 dfw.source.kernel.org (Postfix) with ESMTPS id E55EF612A1; Mon, 21 Mar 2022 13:55:24 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B84A6C340E8; Mon, 21 Mar 2022 13:55:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1647870924; bh=ie2mKoXRPtnkgOIBTSNvK44GyHrmwv3sc63OLsGAZew=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rdrxHT7CTG4uBQAeeMnm0hmZkE3zAwNDX5kxco5hZnN4SiA7UIRxEyQpl1ow+hNz+ WYmwf9Oq5mqN3hlVOFRK2C9emfgRWJeQwsPQba6SodyhFSb9dZSAEEw30a0GYV+8f2 4sMXXNni2f0niRRVkc/01Vd50iXSX+MqN77OyP+w= 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 4.19 19/57] ia64: ensure proper NUMA distance and possible map initialization Date: Mon, 21 Mar 2022 14:52:00 +0100 Message-Id: <20220321133222.544166895@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220321133221.984120927@linuxfoundation.org> References: <20220321133221.984120927@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=-3.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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: Use node_distance instead of slit_distance since this is before the rename that occurred in commit ef78e5ec9214 ("ia64: export node_distance function"), plus a minor context adjustment ] 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 @@ -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; + node_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 */