From patchwork Fri Oct 28 16:49:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Valentin Schneider X-Patchwork-Id: 13024063 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 89BB6FA3743 for ; Fri, 28 Oct 2022 16:51:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230146AbiJ1Qvm (ORCPT ); Fri, 28 Oct 2022 12:51:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46774 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230150AbiJ1Qve (ORCPT ); Fri, 28 Oct 2022 12:51:34 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1A7EF72EF1 for ; Fri, 28 Oct 2022 09:50:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1666975834; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=5IEmsMn5Ai8kZg6GndigRvOK7uC/c82ztM+YMzpgCc8=; b=DlbW/7TwFwGvJrtQSWrcPfb/ICP7hM7C9++myUxZik4d025FoiHUg+4XDc8DZHRF6lISH3 vtogUwVUbtx3KNH1SR6GtbFYxRnAt+mA7ysWNpLsy4I+vFojQJnxUQ8A+js7eWB8H4qwmt IZ2gh9anrGpetJkp+JQkhV5DdmXc238= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-211-lYXjFj9UMCqEdovApyxf4w-1; Fri, 28 Oct 2022 12:50:33 -0400 X-MC-Unique: lYXjFj9UMCqEdovApyxf4w-1 Received: by mail-wm1-f69.google.com with SMTP id 125-20020a1c0283000000b003c5e6b44ebaso744177wmc.9 for ; Fri, 28 Oct 2022 09:50:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=5IEmsMn5Ai8kZg6GndigRvOK7uC/c82ztM+YMzpgCc8=; b=LJ3wzCw2wN6t8Dlnwlyh8SH2sUv1xE70iiNl3ezqzyKiF4pF8+iGSKd8RVketEgZ9x hxTSNx3ap6dGq+tlCHDCT8piulLEp8gmwsxbqrLWTNPiAi4UwUPCnZ3cltNB+VPDvWrI pmjwQqAPk92JvpsSCBdGLfHrRvF9ixZEOfTj5xts2jIZ8fpBqzcNmn0OvdMwiy4Shh2c h1RvmbrxbYhD7oLdh2TAAZcsnzwqePz1ShmzK0+ZJfD93v3d1wggyIrTVzb8XeJfkpFD xCe0ZbwmMz2j99TH7oImbjPlrTOHwK81BVNSEdDh4J/gf5kgr5bXwyx8H29X1tT04DZ5 6+5A== X-Gm-Message-State: ACrzQf3M25eeaA3IOWa4AlPZymQG0hnU4wKIhw5aGMFWZrXq/FzRnhXD atOPZc3y+hKyqHn36mCkHkV/LjkL/nigUs2+PHnPPSXxs0COR83J8fbn8c4ZKCPYSpeEgw8h5WD 9bcIwAKNUUGnxx78c9iHSzw== X-Received: by 2002:a05:600c:1987:b0:3c6:fd37:7776 with SMTP id t7-20020a05600c198700b003c6fd377776mr10502288wmq.72.1666975831813; Fri, 28 Oct 2022 09:50:31 -0700 (PDT) X-Google-Smtp-Source: AMsMyM74cuRyjaHCpA7r3paScYCbeat6QJjVC7nZ8pVMvM74YpYGxqg32Z6AhcfAnDGNtOCVL0MpSw== X-Received: by 2002:a05:600c:1987:b0:3c6:fd37:7776 with SMTP id t7-20020a05600c198700b003c6fd377776mr10502268wmq.72.1666975831554; Fri, 28 Oct 2022 09:50:31 -0700 (PDT) Received: from vschneid.remote.csb ([149.71.65.94]) by smtp.gmail.com with ESMTPSA id ay31-20020a05600c1e1f00b003cf537ec2efsm5065923wmb.36.2022.10.28.09.50.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Oct 2022 09:50:30 -0700 (PDT) From: Valentin Schneider To: netdev@vger.kernel.org, linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Saeed Mahameed , Leon Romanovsky , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Yury Norov , Andy Shevchenko , Rasmus Villemoes , Ingo Molnar , Peter Zijlstra , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Mel Gorman , Greg Kroah-Hartman , Heiko Carstens , Tony Luck , Jonathan Cameron , Gal Pressman , Tariq Toukan , Jesse Brandeburg Subject: [PATCH v6 0/3] sched, net: NUMA-aware CPU spreading interface Date: Fri, 28 Oct 2022 17:49:56 +0100 Message-Id: <20221028164959.1367250-1-vschneid@redhat.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org Hi folks, Tariq pointed out in [1] that drivers allocating IRQ vectors would benefit from having smarter NUMA-awareness (cpumask_local_spread() doesn't quite cut it). The proposed interface involved an array of CPUs and a temporary cpumask, and being my difficult self what I'm proposing here is an interface that doesn't require any temporary storage other than some stack variables (at the cost of one wild macro). [1]: https://lore.kernel.org/all/20220728191203.4055-1-tariqt@nvidia.com/ Revisions ========= v5 -> v6 ++++++++ o Simplified iterator macro (Andy) o Cleaned up sched_numa_hop_mask (Andy, Yury) o Applied Yury's RB tags v4 -> v5 ++++++++ o Rebased onto 6.1-rc1 o Ditched the CPU iterator, moved to a cpumask iterator (Yury) v3 -> v4 ++++++++ o Rebased on top of Yury's bitmap-for-next o Added Tariq's mlx5e patch o Made sched_numa_hop_mask() return cpu_online_mask for the NUMA_NO_NODE && hops=0 case v2 -> v3 ++++++++ o Added for_each_cpu_and() and for_each_cpu_andnot() tests (Yury) o New patches to fix issues raised by running the above o New patch to use for_each_cpu_andnot() in sched/core.c (Yury) v1 -> v2 ++++++++ o Split _find_next_bit() @invert into @invert1 and @invert2 (Yury) o Rebase onto v6.0-rc1 Cheers, Valentin Tariq Toukan (1): net/mlx5e: Improve remote NUMA preferences used for the IRQ affinity hints Valentin Schneider (2): sched/topology: Introduce sched_numa_hop_mask() sched/topology: Introduce for_each_numa_hop_mask() drivers/net/ethernet/mellanox/mlx5/core/eq.c | 18 +++++++++-- include/linux/topology.h | 27 +++++++++++++++++ kernel/sched/topology.c | 32 ++++++++++++++++++++ 3 files changed, 75 insertions(+), 2 deletions(-) Acked-by: Jakub Kicinski --- 2.31.1