Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp3415001pxp; Mon, 14 Mar 2022 19:33:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzMyDODV/c3/gsKQyoaDzHjeFXcBjXdV2G6qZ86mIT7QfGV/jEU0S1Rs4SkpTZqHrd3ygTy X-Received: by 2002:a17:90b:3117:b0:1bf:70e7:2543 with SMTP id gc23-20020a17090b311700b001bf70e72543mr2130964pjb.37.1647311590197; Mon, 14 Mar 2022 19:33:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647311590; cv=none; d=google.com; s=arc-20160816; b=BH+QES1SLm2aeKdyH3k1jCFrWDvOUCi1GBkP5HTGQCPDttIordJwGQJ9R+oIjMGdMe lv/n/GBcPCB8PGq+WbESnhvVkAHcH56kgZmQ2MYdrvG483PIbbk18CZzq6iHv5K3vZ8F KmXqW74xx1rSGtJSQvVnpWuCt7fhU0SIJbfWqA9vTci2Cfn3WI6fIyRotDBS0ERR9OeD g1w3qq4pGtXWcoTOt1XtgcNTK3y0ws0bsI1GI7zgvDWak/yz2aGZeIwcPjVsppQVKPP6 P5WvWAXDup1OlON7jk1Tl5SZ5FKqdQ/dJ3gbE392PxpC6dO2VHpA6eLZE0LxsGjwoBZD kkNQ== 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=afsbMijLFZikxQUc8nmOO/PT6l0zGWwfOZFI1wH2/eQ=; b=WhtNUJakRz4vgPl3HdtRoA4Ple7ltjNv8cI4vdxxk30LHj79uAYOIqbqjzL4YLoejk YyNmfneUkHCt78hO2icb0HifkuRTV9Cs+rnVtyc5KiGbW7RQjMI1BzM2V0H8j7edg+Eg bqIM/6HV0AioeyV1bYCFE8W1JXCbgu5DuoSl/JFNi4jhATBr4UbZPr0etWDoLnzNU8qO AaebHQW7SYVkywK423zYU01B6/kXMKqaz23UiNzEX+rPT1pNhoRKWXTYjKavMMC2fK1f bLPIwpUdjchhodbTZhbePAyfOrOF0DoJ3jVcW4O4dhGpRBYEF2WHIMHLCGbAN0QyqGvf HG2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=fj6eRojM; 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 h10-20020a170902f54a00b0015200d91781si16889756plf.412.2022.03.14.19.32.55; Mon, 14 Mar 2022 19:33:10 -0700 (PDT) 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=fj6eRojM; 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 S239548AbiCNLpC (ORCPT + 99 others); Mon, 14 Mar 2022 07:45:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40910 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239587AbiCNLmh (ORCPT ); Mon, 14 Mar 2022 07:42:37 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9FA6B488A2; Mon, 14 Mar 2022 04:40:06 -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 72FA261170; Mon, 14 Mar 2022 11:40:06 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 74B26C340EC; Mon, 14 Mar 2022 11:40:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1647258005; bh=pVanl608lm9vBB9wPqPyFibFmrjbxufCym3Ml+FPZr0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fj6eRojMF6H3N14WRSdI1x1uCBsO1ieDZvdeGo4EASQ1prKM9TozVF+xBJkB8Lx+O zo9Pvh4fQDKptREeUoaxC/zeKHkrNza4jwRXucMsHzzlAO1J92p5RHHRXYFpPXLQ0z 2Uww+ocY+8up1xV6x6g7oei5eWRNqOjzbcN//YW8= 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 30/30] ia64: ensure proper NUMA distance and possible map initialization Date: Mon, 14 Mar 2022 12:34:48 +0100 Message-Id: <20220314112732.641129681@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220314112731.785042288@linuxfoundation.org> References: <20220314112731.785042288@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=-8.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 [ dannf: minor context adjustment in arch/ia64/kernel/acpi.c ] 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; + 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 */