Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp2028253imw; Sat, 16 Jul 2022 22:44:13 -0700 (PDT) X-Google-Smtp-Source: AGRyM1v7mOV2spSbhvx9cQsSgFCizRGiA44gpUmdXyHpe21Mmk1L4lNEXIAVisLW/on4iDBy8WVU X-Received: by 2002:a17:907:2d93:b0:72b:60a0:6b2e with SMTP id gt19-20020a1709072d9300b0072b60a06b2emr20813811ejc.487.1658036652959; Sat, 16 Jul 2022 22:44:12 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1658036652; cv=pass; d=google.com; s=arc-20160816; b=uqJVLQQBhLAzIuAcdYGfs1wEOS/tKS5/uEZUJ3tPOYhb8vO3ajNm8xGkD/HJ2p7iN4 SDZxT8XqSKRyVRPhujF0WZDv1HREW/px2h1OKWhBYx7jueq8uaGilKfN0Ol2KmnjQj5u 4CnGHVqXi+EJbczrtF2yuPNdSc1wbN7Ji2IDVyofwUdAkr2WcY3vqutr0BDvy8TLNltz FbCctr/YMCpwJ1YfN13ON6k8Vx0/GetlJDMJJCPvw06yVVl+L3J5OLB2SNahMiUZrThd SAHUpvdbEbnwRVrfN+Za1NmRO/Xa0UGCrV1fVJPvnphmTYPU7uDZJxpwm+Xg6s1Sa8ob Vu6w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=BgL0DMNZBJFhcAW4/h+VMHZBkUqzxMGYipZLwDCd3zM=; b=SIqso6sIP6pMIXcFV94A+mrQpbtTiXMMEXXn6FSY+NFAhgBkh55O7jZ/x2MoQjbgE1 pR9d2doWmRL6TIzpjxT21Gbe7kU5TDaH8kQEsJQKk/1F3db6sKaHLPSKDsXWZB/I4taJ reVsovcsRU9044cJM13IcVd4YXZ1dF6b+dJGCYW73zAoH6rT3XqFKT3kX6tlK00ojSHa 3dqBktJFoO3AtI8ob4PMOmrerDo5febbAPAOES5iWZTp7VgPTJ98TpXzi2y74J2Gkowg yDCu5CKymsl3QN2ZwC7EGiQyz7jKuxe8LNCOkPFuJl8kYLnWwZlQXTJhwCtHDFOUKlVt zNdw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=Q3bRZ4AL; arc=pass (i=1 spf=pass spfdomain=nvidia.com dmarc=pass fromdomain=nvidia.com); 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=REJECT sp=REJECT dis=NONE) header.from=nvidia.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bo14-20020a0564020b2e00b00435abcf8f71si9148245edb.142.2022.07.16.22.43.40; Sat, 16 Jul 2022 22:44:12 -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=@Nvidia.com header.s=selector2 header.b=Q3bRZ4AL; arc=pass (i=1 spf=pass spfdomain=nvidia.com dmarc=pass fromdomain=nvidia.com); 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=REJECT sp=REJECT dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232508AbiGQFXu (ORCPT + 99 others); Sun, 17 Jul 2022 01:23:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39306 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232347AbiGQFXs (ORCPT ); Sun, 17 Jul 2022 01:23:48 -0400 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2041.outbound.protection.outlook.com [40.107.93.41]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 75F55FF8; Sat, 16 Jul 2022 22:23:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LjTVe4oVfmczSgWU5LO9GWcrvSN8wj8T6oHmEOZJupq+UCP5cFp9bQJBLAT0CzSdlF5u9UfTKgE9ZDD1kgm6eUy/0hyiifDAc3u18+r4V9gzbnL6hzyMlHwpMmwW9lJLGFap14msUerWg72cB1Iw7kbJ+wCU8yRbIYSlNXyMXdDSceKK3txW963qFhGs6W+sGodeak+l/XMrkCdKBPWV4CiHEXDD7wcneXH3Atq1d9kZcux7y0OEwHvP3pUJxYZAGF6TTCY+g3MrhomhL0BA1pQbWJ1FrazL321mUwhhmyUzniVpKPrPAnKJpc4vcOLd+Frl4jAcHNyiYLd2z+MwAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=BgL0DMNZBJFhcAW4/h+VMHZBkUqzxMGYipZLwDCd3zM=; b=Vr8o4xpd8pPqwhwdxOc0lNFUCMYfFh8IucqIrKvj89oZpEIFCfazCEeHPt/O7ppJc7xTxK6qNXhMJPz0QZvX0lHqJX6nkf/dOM7GeGA4ZWahX6XoU/YiB5jeJ0yzOdAB/Xya8e4TDgTSfJGEJur/C/j3X+1yRK6dFyLMmuPV0tixSdgUJdjlAbgTBp7JZfi6PWFzsdECF802xHBLy7l9i+U0+PSsQiVqLdxq/tWV7bwHhTRnLwGWSPshkSMQaeW1NANdRUIX06VEGJhZHgKONY9cspMn7XZ+PtkqqN6+WB1Q2Fuse3q0BlSmQodRMUdHenZ6enFrj2f3t2PE46LHGw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 12.22.5.236) smtp.rcpttodomain=redhat.com smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=BgL0DMNZBJFhcAW4/h+VMHZBkUqzxMGYipZLwDCd3zM=; b=Q3bRZ4AL3HX0zJkJqjrJR+q4iOU1Ry4OQ2+qMHURsPexgRNlBa+qNvTi5wbgUb+zkD7QYjeI16iF3SLMeeyw1wqILeIpgXSGI9EAIFS2YKMOQS4zX7RE4oPxXVf2KensuYDvtA4YYNR+nYPKwqdJ8Y++nnXz0JT+NWKH2+x1YqG+pDJS1jQtCNdk+Z+vOsGER4Emdz2eGF3fktXXZGTrga7lQmaYBZhO8ZmbdCZSMVNz+G30B+Vc1qwZxX+6TuHeH7U0wfIgEzc6QmCL1BP1eE4e7NU37iFV7p+wkZ6niE6gABAZQ27lf2q7X2NDuC5Z8OoOIcZkI501xpGSGbQ2tw== Received: from MW4PR03CA0024.namprd03.prod.outlook.com (2603:10b6:303:8f::29) by SJ1PR12MB6172.namprd12.prod.outlook.com (2603:10b6:a03:459::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5438.22; Sun, 17 Jul 2022 05:23:43 +0000 Received: from CO1NAM11FT068.eop-nam11.prod.protection.outlook.com (2603:10b6:303:8f:cafe::a3) by MW4PR03CA0024.outlook.office365.com (2603:10b6:303:8f::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5395.15 via Frontend Transport; Sun, 17 Jul 2022 05:23:43 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 12.22.5.236) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 12.22.5.236 as permitted sender) receiver=protection.outlook.com; client-ip=12.22.5.236; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (12.22.5.236) by CO1NAM11FT068.mail.protection.outlook.com (10.13.175.142) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.5438.12 via Frontend Transport; Sun, 17 Jul 2022 05:23:42 +0000 Received: from rnnvmail205.nvidia.com (10.129.68.10) by DRHQMAIL109.nvidia.com (10.27.9.19) with Microsoft SMTP Server (TLS) id 15.0.1497.32; Sun, 17 Jul 2022 05:23:42 +0000 Received: from rnnvmail202.nvidia.com (10.129.68.7) by rnnvmail205.nvidia.com (10.129.68.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.26; Sat, 16 Jul 2022 22:23:41 -0700 Received: from vdi.nvidia.com (10.127.8.14) by mail.nvidia.com (10.129.68.7) with Microsoft SMTP Server id 15.2.986.26 via Frontend Transport; Sat, 16 Jul 2022 22:23:38 -0700 From: Tariq Toukan To: "David S. Miller" , Saeed Mahameed , Jakub Kicinski , Ingo Molnar , Peter Zijlstra , Juri Lelli CC: Eric Dumazet , Paolo Abeni , , Gal Pressman , Vincent Guittot , , Tariq Toukan Subject: [PATCH net-next 1/2] sched/topology: Expose sched_numa_find_closest Date: Sun, 17 Jul 2022 08:23:00 +0300 Message-ID: <20220717052301.19067-2-tariqt@nvidia.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20220717052301.19067-1-tariqt@nvidia.com> References: <20220717052301.19067-1-tariqt@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 72d42366-dde2-47aa-32ce-08da67b483da X-MS-TrafficTypeDiagnostic: SJ1PR12MB6172:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: lEHgQx5hZCOuGHU1wYR3KiF/jWiEsaN6uhqb9QUlEibaGEqt+04KGgWiqEfseC9jhrCFaNoCkojvJAKc3BBcHEBtoBbnVY/ratvMBzp8wnA+qdPg/O5AegCMve5SAIt+y51paQqFr3qCRiKEV+NAvm1TeMudke9shk2Qxydg89+3xs/xboZVsZFOh0B41tX6qMrTevzTf8wedwZqTDYE4aEqNhNCWQsDxNDfAYpEoblE/fjdl4erkRTtOFC+g4/W/YmT+AWo8+7ZQ3gU8Y7qRWdZq9OKEUAqZLnbyw4YMVRiqeR0++RgHdvOw9q5CdzejRdpUjF/WhdWyCMV6vEujERzDiacuCLpAX0Jsdp1uzgWzHWNQ6SKny2A2JCDqGUfmOk+G5vKwEu00EpNeuqK3rJ/+aWoIVVYAySBfmir0HFEH+mpfy58U0I+gZo+mTiJe9TSGIeZxjm0Y87J23m6LKM3qkCIpq8zIIYNl8nJ1RJR3yMnvu27UwiAWgn7dOzHwjYZhxnio3m5SBxlFq24KbpxM4EusZFvh+vlvGQ1usPnd3SXKVWnUDYl6lLmW8rQDwfWHlnLI4vXdlTcmJQcq2kdyLOl9b2p82sTJM6RK6vaGCcp9atc+Nb7fS3fYJEOjkixf2NlfV5RBi7Z8whrdB7OUv3jj9igsji/023DutDaN3t4XQ2pKco53QZFUT2kcKuv34aHEpxo1puAjE3PlrFQdLD2FeopZbE4Kvecc+ZPLut8/1nWiblrUxd5uo4qNX6uVuBfwBV9JK8sh6hMnbzenORFsIm83Zpk4uygzB9cnPAcrmqgLSan/vn0TK06qhBW54hXj9vbZwZAWLtwZP5EyKeWsEAJb3wm1B/v/YA= X-Forefront-Antispam-Report: CIP:12.22.5.236;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:InfoNoRecords;CAT:NONE;SFS:(13230016)(4636009)(396003)(376002)(136003)(39860400002)(346002)(40470700004)(46966006)(36840700001)(36756003)(186003)(110136005)(316002)(2616005)(7696005)(478600001)(1076003)(54906003)(107886003)(86362001)(82740400003)(426003)(47076005)(336012)(82310400005)(81166007)(2906002)(83380400001)(356005)(41300700001)(6666004)(40480700001)(40460700003)(70586007)(70206006)(36860700001)(8676002)(4326008)(26005)(8936002)(7416002)(5660300002)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jul 2022 05:23:42.8985 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 72d42366-dde2-47aa-32ce-08da67b483da X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[12.22.5.236];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT068.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ1PR12MB6172 X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE autolearn=no 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 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); #endif /* CONFIG_NUMA */ -- 2.21.0