Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp3182925imw; Mon, 18 Jul 2022 03:42:37 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vSCBo1c5wBCc3WAx6vwFvJVBDTRo3UOG9QnnxKbzNymVmLeG+40Iw5Nwh1PHuKxxGi6uBW X-Received: by 2002:a05:6870:891d:b0:10b:95e3:3d8f with SMTP id i29-20020a056870891d00b0010b95e33d8fmr16610270oao.54.1658140956984; Mon, 18 Jul 2022 03:42:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658140956; cv=none; d=google.com; s=arc-20160816; b=j8/8spEc11vv2qWJdTshxd/HQPO0PTrcvdwBKRn9W2ocq11yZMbRoJIFRXCy7tQ4NR aJrcW/9uES9WKMSeR/BOJL+Frc9pkLYIyQ5/ftzd0QwDdWIvWzdXnSJ8VEQcaGT2osys psQCygiMWn2P0C59FLJdWZelPpJjHboSBc20dYlWev3cfZFTtbHncV2cVxSmtgTthErh bvlRYfuh+YqnSurrybAK/Z0K8mIuek13sKjWOTe7XJsHWKVr48kegJmQGm5pdOMXbBhC /QHrm1+4hVPagXT+KwbXjiUdp6qQwq8EUET4sBrzei+ET+TP8bxoHJPxUPMjoetl4hQh ltRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=Ijs/RSv7qHQbvm9v+Fy+Qzb4VPBB1zdP6a7q0FZ2hyY=; b=yfKfcbgB6JSkRU5My8mk8A+XHHw/hU2TZcrXaaXEN3uGukSIkMj6hMyG6gg6nB1oJz cdn70Q/mMQGwWA8XF0ud45M+en2QTltIFvhQ4XtBPOyQMfUFSoO2bk6B2jsJnc/sHM82 xfg0SHRwkx9hQBF221yIez95iXZB2CvYsK213QBdPYTpwUoASjrK8v1Z4C5Sqf4VNatE XLjsrX1WCGJDYqhDn93AEc0VNNZQ1HQ3gzAgBERphbbiwoC4drj8rkIaGXETP+jTGy9p M5vGdVimGTmgap2p/I7c5Fg7zhwt7tmsb8AD+g/ndE9anXZ32xZWyetaQarR3OxkfrDx 5CcQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=mMUTuFO2; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v7-20020a05683018c700b0061caeda99f8si28718ote.59.2022.07.18.03.42.21; Mon, 18 Jul 2022 03:42:36 -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=@infradead.org header.s=casper.20170209 header.b=mMUTuFO2; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233726AbiGRKTw (ORCPT + 99 others); Mon, 18 Jul 2022 06:19:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34058 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230054AbiGRKTv (ORCPT ); Mon, 18 Jul 2022 06:19:51 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 90A411C901; Mon, 18 Jul 2022 03:19:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=Ijs/RSv7qHQbvm9v+Fy+Qzb4VPBB1zdP6a7q0FZ2hyY=; b=mMUTuFO2xqKNFtna0kmQNGmRa+ WQr6Gj2zDbk2LspuJH11pLa6ym0tcz0Ptv/eQ5EbMRdIqykF6+pi5NX/WeqNHzIW5QlUaAVHRMKkn MrfgUjKSDUZ2WFBi8cOnM/rxYytl7+sk6K6zWdO+n78+VU/wBimLTaZyUBJ22l5P7zmiN7TyYXsMH gOtvcXXNpFNDbeTpzoB3jfJIgeeUHAerDtDX1FpOfaFHaEqzFWja7M5rmLlTeACcYrdsDFL/ScYiJ Qqj7OWkWp42t++1844ZuMsPoXFb5tPRpaTo0lmPJtB2Aout9jPZRjJvXyAc3evas6rGs7IuOQIx8i WZXQuiRA==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=worktop.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1oDNql-00CbGs-Kd; Mon, 18 Jul 2022 10:19:39 +0000 Received: by worktop.programming.kicks-ass.net (Postfix, from userid 1000) id 390EA980226; Mon, 18 Jul 2022 12:19:39 +0200 (CEST) Date: Mon, 18 Jul 2022 12:19:39 +0200 From: Peter Zijlstra To: Tariq Toukan Cc: "David S. Miller" , Saeed Mahameed , Jakub Kicinski , Ingo Molnar , Juri Lelli , Eric Dumazet , Paolo Abeni , netdev@vger.kernel.org, Gal Pressman , Vincent Guittot , linux-kernel@vger.kernel.org Subject: Re: [PATCH net-next 1/2] sched/topology: Expose sched_numa_find_closest Message-ID: References: <20220717052301.19067-1-tariqt@nvidia.com> <20220717052301.19067-2-tariqt@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220717052301.19067-2-tariqt@nvidia.com> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE 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 On Sun, Jul 17, 2022 at 08:23:00AM +0300, Tariq Toukan wrote: > This logic can help device drivers prefer some remote cpus > over others, according to the NUMA distance metrics. > > Reviewed-by: Gal Pressman > Signed-off-by: Tariq Toukan > --- > include/linux/sched/topology.h | 2 ++ > kernel/sched/topology.c | 1 + > 2 files changed, 3 insertions(+) > > diff --git a/include/linux/sched/topology.h b/include/linux/sched/topology.h > index 56cffe42abbc..d467c30bdbb9 100644 > --- a/include/linux/sched/topology.h > +++ b/include/linux/sched/topology.h > @@ -61,6 +61,8 @@ static inline int cpu_numa_flags(void) > { > return SD_NUMA; > } > + > +int sched_numa_find_closest(const struct cpumask *cpus, int cpu); > #endif > > extern int arch_asym_cpu_priority(int cpu); > diff --git a/kernel/sched/topology.c b/kernel/sched/topology.c > index 05b6c2ad90b9..688334ac4980 100644 > --- a/kernel/sched/topology.c > +++ b/kernel/sched/topology.c > @@ -2066,6 +2066,7 @@ int sched_numa_find_closest(const struct cpumask *cpus, int cpu) > > return found; > } > +EXPORT_SYMBOL(sched_numa_find_closest); EXPORT_SYMBOL_GPL() if anything. Also, this thing will be subject to sched_domains, that means that if someone uses cpusets or other means to partition the machine, that effects the result. Is that what you want?