From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C9102C2B9F8 for ; Tue, 25 May 2021 10:21:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A08DD61417 for ; Tue, 25 May 2021 10:21:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231406AbhEYKWk (ORCPT ); Tue, 25 May 2021 06:22:40 -0400 Received: from foss.arm.com ([217.140.110.172]:54340 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231355AbhEYKWg (ORCPT ); Tue, 25 May 2021 06:22:36 -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 ECC79D6E; Tue, 25 May 2021 03:21:06 -0700 (PDT) Received: from e113632-lin (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 148883F719; Tue, 25 May 2021 03:21:04 -0700 (PDT) From: Valentin Schneider To: Srikar Dronamraju Cc: Peter Zijlstra , Ingo Molnar , LKML , Mel Gorman , Rik van Riel , Thomas Gleixner , Vincent Guittot , Dietmar Eggemann , linuxppc-dev@lists.ozlabs.org, Nathan Lynch , Michael Ellerman , Scott Cheloha , Gautham R Shenoy , Geetika Moolchandani Subject: Re: [PATCH 1/3] sched/topology: Allow archs to populate distance map In-Reply-To: <20210524161829.GL2633526@linux.vnet.ibm.com> References: <20210520154427.1041031-1-srikar@linux.vnet.ibm.com> <20210520154427.1041031-2-srikar@linux.vnet.ibm.com> <20210521023802.GE2633526@linux.vnet.ibm.com> <20210521092830.GF2633526@linux.vnet.ibm.com> <87k0no6wuu.mognet@arm.com> <20210524161829.GL2633526@linux.vnet.ibm.com> Date: Tue, 25 May 2021 11:21:02 +0100 Message-ID: <87h7irglm9.mognet@arm.com> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 24/05/21 21:48, Srikar Dronamraju wrote: > * Valentin Schneider [2021-05-24 15:16:09]: >> Ok so from your arch you can figure out the *size* of the set of unique >> distances, but not the individual node_distance(a, b)... That's quite >> unfortunate. > > Yes, thats true. > >> >> I suppose one way to avoid the hook would be to write some "fake" distance >> values into your distance_lookup_table[] for offline nodes using your >> distance_ref_point_depth thing, i.e. ensure an iteration of >> node_distance(a, b) covers all distance values [1]. You can then keep patch >> 3 around, and that should roughly be it. >> > > Yes, this would suffice but to me its not very clean. > static int found[distance_ref_point_depth]; > > for_each_node(node){ > int i, nd, distance = LOCAL_DISTANCE; > goto out; > > nd = node_distance(node, first_online_node) > for (i=0; i < distance_ref_point_depth; i++, distance *= 2) { > if (node_online) { > if (distance != nd) > continue; > found[i] ++; > break; > } > if (found[i]) > continue; > distance_lookup_table[node][i] = distance_lookup_table[first_online_node][i]; > found[i] ++; > break; > } > } > > But do note: We are setting a precedent for node distance between two nodes > to change. > Indeed. AFAICT it's that or the unique-distance-values hook :/