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: 838 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp937877wru; Fri, 28 Oct 2022 09:57:25 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7YsYjQOGacTOeWgZJyqlrFxh0hdg/jSW7lFsP8mGNuH3Dsn2XzSuXiOH1uIVTv/3yV4J8B X-Received: by 2002:aa7:8293:0:b0:563:5852:e750 with SMTP id s19-20020aa78293000000b005635852e750mr176134pfm.11.1666976244769; Fri, 28 Oct 2022 09:57:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666976244; cv=none; d=google.com; s=arc-20160816; b=02iPjjFY3RdivPV4h7UB/ATVl1umgkw6VSBpbgeVWopypJW1XqS4Igvn2plwIXr6J2 vnT/GILVsUmX2IGy0pQuOfFB1dCbA6FtBx/Omj1aKAceCYWwqoWa12XwZUgF4fm3R09g pad5T+Lfik/TkVYVDxDv42BTIGQhWx/yxEAPsR/CJhzhrzP3N2If6yjvEMaSN0t+L5RV 99RCsN5LPXeOAESGcGYn6PianUIXJMkktlb/8xBLYz9V7/Za1RByWdSGuhQ2/eCgbrv1 Nwm6J7189jqIfCxV5HmCnzt2S21+q/qgNVI5ipatwNNVJhB76zXZGjs5DMfImyQDTJYj OZnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=5IEmsMn5Ai8kZg6GndigRvOK7uC/c82ztM+YMzpgCc8=; b=Z/GGJwFZ6gmoUg2Qki/Fea5ochtSDp4RWk2in12rrTcQy484sRbVVVrWBEQ74djqGF /91QsMTZLOjIqQALVKw/V/AwR9Hnqm2CpmJTCjrYe1dOwP0jo45ipTu3TK8DNNSbC0mS mgSP2e3uDp3dxmKq6KnfkAipaF2+IQOxj4twUZqVlIG50MTJ/Nn7Mn05Mr6+EvIY3ktZ usdm4Rb3Tiw0BrfEBTks9UCLq0lfHT0/+JnerUE2eFDUKM1gia6cXepSSCkpPzfizZ9S 9VCfJ1RyhO6XTwdOnCfwKhjcR6W0J5p1FwKRkNXCm4cTRX86rl2EfDq2rOAP4DY/p61k TCjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=b4FFRdbX; 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=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z65-20020a17090a6d4700b0021343bcdf6csi5570838pjj.48.2022.10.28.09.57.10; Fri, 28 Oct 2022 09:57:24 -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=@redhat.com header.s=mimecast20190719 header.b=b4FFRdbX; 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=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230219AbiJ1Qvw (ORCPT + 99 others); Fri, 28 Oct 2022 12:51:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46834 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230111AbiJ1Qvg (ORCPT ); Fri, 28 Oct 2022 12:51:36 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7B34D785AC for ; Fri, 28 Oct 2022 09:50:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1666975835; 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=b4FFRdbX/dduyaFEfGurLwWeG8RXKLyt4/8T/qqAb950L5migdxpxEaDvSaDpmvglseZB/ YkB7sf4QE89ZnuUuHfMfWgHYddFCvxBPMSu8ZdKktBXgauRSE2l3rfYHWTK7/WcJrL/l4W 2XbpWZKv4TjJMwr8kPgmsLpbOomBPpw= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-424-wvjCl9GjOduI-m8_fBH2kw-1; Fri, 28 Oct 2022 12:50:34 -0400 X-MC-Unique: wvjCl9GjOduI-m8_fBH2kw-1 Received: by mail-wm1-f70.google.com with SMTP id x10-20020a05600c420a00b003cf4dbff2e4so2195724wmh.8 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=DKnE4bIoY/3p3z8EhdjO47QAX5qlpjY5Ovbliw0q/tb9/19kJS7olwxgZrdk3LH3kF dKpbQY4hCafS69BDfanyURYgdIiZZfhkj6+fVpejyoVOlE4wNyFZQLv5AxV0LhhzokHr d7rIA4mbHbZ+uMtZlQfHKDOA5XhE4xvjL5dH8I95IuqooYtu/gsulDAAW5erDDe5UkFj ECLfAnU7BlsApa0Nc0KqTzHiyBHhAkBx/0kilWdpmAVs0sWAiSMwuRlSD9oPobQ8k88y /Mt+Q2LQltFhkK5Tn2JhH8zeV1aKN+jiPFrKECJ94STuX7peB51cqFpqqJstDtIf2tdr ZgIA== X-Gm-Message-State: ACrzQf0EViLCi4jnrHp0dtRjI6497VTQ3fQgssQDxMeFUoz9cfrkB+2n YrmxRYTIJfhfIoBmioJTTa9U0+OEinCNs5dWIDx2eXqrv17UKPLQ6Kog01Qnl8T9hYJ7+OCKCx4 kQqmo7ojZ7PYbNBirI0lwHBEY X-Received: by 2002:a05:600c:1987:b0:3c6:fd37:7776 with SMTP id t7-20020a05600c198700b003c6fd377776mr10502292wmq.72.1666975831814; Fri, 28 Oct 2022 09:50:31 -0700 (PDT) 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 X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=unavailable 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747951283076849722?= X-GMAIL-MSGID: =?utf-8?q?1747951283076849722?= 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