Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp2336442pxf; Sat, 20 Mar 2021 12:09:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzFzDDsGzlQKBfPz7bpQaBaDLDfGM/alAKWYJCNzIZ9CPFem4I2kltMujycazvoGnbIbpqk X-Received: by 2002:aa7:c9d1:: with SMTP id i17mr16479177edt.46.1616267341064; Sat, 20 Mar 2021 12:09:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616267341; cv=none; d=google.com; s=arc-20160816; b=dB3xok9kabh7rbz7lxm2/4MlSaoU1w4MVPYugh+KQv1NKILCB5mguQDo+tY7WP3sFd 5SWq7hBy8xmPtMPPS7ugy+xJnMnLs+kKdmF+1EmDwb/YycvGRktsgaJB3tL5eSaX58U8 W3olA2iYit+GlG8caDKiOBz2f941L3c5wMUBhkTKy1TEtsEehr2jwf5JLXdhh4L/flZY WbTS4Yi4S10+ikpT0Dt/MW9RgR06qbQ2BxLySTbIIfUnpz3DJzPif7XGTjhXPbFK1uRo txHL9+P68DzTFfDhw8FaRix661pUwWOcrvJwRlwHdPFslptWk8jaXkCp4znSewInRO/o Q/Zw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=Kq/Oy5cOogU6oSf2CnMFMasxkQDiEQRWnm1irWgIKFs=; b=Y2J5kspQRraBPZhYrWHHh+4Pj/5sG/TgkMCrG3YZfQIk8Ug9Jg6PeKSpftr6DQKZU+ qsThAs2ExZKOVVQTrlb1v+odXqrvQWz3OV62U9FxWjUAofGzMoVSXi3mOd0eeWGjAg1b WFghXx2fPaRXRa7g0BWU0ebAXQ/oAWXCdV+99vVRrQtyhaiU96JARVVVwQ35sJhcUOPg drMzZ8D0S1zikgUh+SmJYRYUhiX0io0cZcQJa8Hs0sxRvRFyPo4+7Cen+LK4ZW0Zf9ta lYMZJaxbrRwkDhXGkV+oIjueRG3eLcHGyszHnj3ixIUfO0bl61i5CH/QYBpXqrqM44aH bBhQ== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h6si6853836ejt.184.2021.03.20.12.08.38; Sat, 20 Mar 2021 12:09:01 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229922AbhCTTDF (ORCPT + 99 others); Sat, 20 Mar 2021 15:03:05 -0400 Received: from outpost1.zedat.fu-berlin.de ([130.133.4.66]:59909 "EHLO outpost1.zedat.fu-berlin.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229920AbhCTTCo (ORCPT ); Sat, 20 Mar 2021 15:02:44 -0400 Received: from inpost2.zedat.fu-berlin.de ([130.133.4.69]) by outpost.zedat.fu-berlin.de (Exim 4.94) with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (envelope-from ) id 1lNgrs-001gkp-5q; Sat, 20 Mar 2021 20:02:36 +0100 Received: from p5b13afd4.dip0.t-ipconnect.de ([91.19.175.212] helo=[192.168.178.139]) by inpost2.zedat.fu-berlin.de (Exim 4.94) with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (envelope-from ) id 1lNgrr-0003ld-V5; Sat, 20 Mar 2021 20:02:36 +0100 Subject: Re: [PATCH] ia64: Ensure proper NUMA distance and possible map initialization To: Sergei Trofimovich Cc: Valentin Schneider , linux-kernel@vger.kernel.org, "linux-ia64@vger.kernel.org" , debian-ia64 , "Peter Zijlstra (Intel)" , Ingo Molnar , Vincent Guittot , Dietmar Eggemann , Anatoly Pugachev , Andrew Morton References: <20210318130617.896309-1-valentin.schneider@arm.com> <3c421868-d6a8-1da2-f876-49b6374270dc@physik.fu-berlin.de> <20210319191059.2a776cb8@sf> From: John Paul Adrian Glaubitz Message-ID: <2bcb5146-4142-05c5-1b44-18a69118ee19@physik.fu-berlin.de> Date: Sat, 20 Mar 2021 20:02:35 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: <20210319191059.2a776cb8@sf> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Original-Sender: glaubitz@physik.fu-berlin.de X-Originating-IP: 91.19.175.212 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 3/19/21 8:10 PM, Sergei Trofimovich wrote: > On Fri, 19 Mar 2021 15:47:09 +0100 > John Paul Adrian Glaubitz wrote: > >> Hi Valentin! >> >> On 3/18/21 2:06 PM, Valentin Schneider wrote: >>> 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 */ >>> >>> >> >> Tested-by: John Paul Adrian Glaubitz >> >> Could you send this patch through Andrew Morton's tree? The ia64 port currently >> has no maintainer, so we have to use an alternative tree. >> >> @Sergei: Could you test/ack this patch as well? > > Booted successfully without problems on rx3600. > > Tested-by: Sergei Trofimovich Great, thanks! @Andrew: Could you pick up this patch through your tree? Adrian -- .''`. John Paul Adrian Glaubitz : :' : Debian Developer - glaubitz@debian.org `. `' Freie Universitaet Berlin - glaubitz@physik.fu-berlin.de `- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913