Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp4907348rdh; Wed, 29 Nov 2023 14:25:53 -0800 (PST) X-Google-Smtp-Source: AGHT+IHHm9qqGKehMpVNR3jhszmvHEYSpG+delDQqrq+tQS5vNyckLs7oI9+fk9rfsGPCWnziEeN X-Received: by 2002:a17:90a:6096:b0:285:8a2a:173f with SMTP id z22-20020a17090a609600b002858a2a173fmr19594473pji.0.1701296753592; Wed, 29 Nov 2023 14:25:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701296753; cv=none; d=google.com; s=arc-20160816; b=UsQFtAbOHC1/bGK6nSmeSU4r36XaReaKGsDd8FTPE7eTrIl7tFsJLZpAv9bOP5YDF2 o2H3JKiL2Y6Finp0qe9ROj3n+LPMcI0TfNDtrWzgclnBxhdmv51+S0clcncqpQ2sNioX Gc1o0vfqKKFBxGr4IroXmZ6Ge48y1afMyIlHMVUEuRlT5YkqwIB7CutMMv++e5jHlM+p +kfuK1O812KNWt27f6FNGlfWhGDHMkiSE8HrmYJzqPHeC5ARiZVlZmMyvaGds4Md3fI8 lu/x5bjbw2QC4kgJaam7S/QEs8ihAGjnxYJRY71aWggcBjlpxNxyfI+sYInrMVGy8k+L 815Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature:dkim-filter; bh=N2gdfXEtDL56X5KE/D0j4gq3nXY5wXUdieLJyNGatYw=; fh=w0Z5x7NVaUVp30UgyxHcRk58djIxAhJZSjTpNY+NfjI=; b=DKyU0KjXzDBHVdIq7kTUQa/HcbH03lw7ZnbJ1AaOLcyqlZtcxyQM2twgTYwFYJcv3i /zJmhPhbaR2JiVUXLTZFYtwy6eROvvzpdEWDKVEjNRTwJbQt7DFE2eRME4LdflGeWy+L +X75njYkvmeGOAhALU6MA5uPF1S/hetY3dVcPrjXlIIRAEiBhkmHZUyAr4VF1rahpw3a T9vxR7x7iEiZXqNuCYj6/QIrgqp3ddFd4Ndu7slHBpXJFx2ygwsMT545nXpcvlR4AKzQ dVTttUQbkEty+NvJpA2EMYTpj73rkO2VJRwlgZf/nXdWZM/k5PLhxErsx8xUBb782faD lokA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=XWLmTpVL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.microsoft.com Return-Path: Received: from fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id nu12-20020a17090b1b0c00b002839b4b17a9si2227353pjb.97.2023.11.29.14.25.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Nov 2023 14:25:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=XWLmTpVL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.microsoft.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 5363F806A86F; Wed, 29 Nov 2023 14:25:50 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343569AbjK2WZS (ORCPT + 99 others); Wed, 29 Nov 2023 17:25:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44442 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343571AbjK2WZP (ORCPT ); Wed, 29 Nov 2023 17:25:15 -0500 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 831A12110; Wed, 29 Nov 2023 14:24:33 -0800 (PST) Received: by linux.microsoft.com (Postfix, from userid 1099) id 9588F20B74C0; Wed, 29 Nov 2023 14:24:09 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 9588F20B74C0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1701296649; bh=N2gdfXEtDL56X5KE/D0j4gq3nXY5wXUdieLJyNGatYw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=XWLmTpVLwaymFnm+nj/NzdoCTbgU5Yq4t++iTerQS4gun/c9T2VPZXRe4B8ZSmTnx jEzZbHrFONut7aDGdNfuCN1ofKSWm62bYhihGrf99LULdc263L9iqfX/rYK4m6qrQR uSU8pIMgHSWdL9HQef+Nisw4YQOeUkHEuXu1Z4aw= Date: Wed, 29 Nov 2023 14:24:09 -0800 From: Souradeep Chakrabarti To: Florian Fainelli Cc: Souradeep Chakrabarti , Jakub Kicinski , KY Srinivasan , Haiyang Zhang , "wei.liu@kernel.org" , Dexuan Cui , "davem@davemloft.net" , "edumazet@google.com" , "pabeni@redhat.com" , Long Li , "sharmaajay@microsoft.com" , "leon@kernel.org" , "cai.huoqing@linux.dev" , "ssengar@linux.microsoft.com" , "vkuznets@redhat.com" , "tglx@linutronix.de" , "linux-hyperv@vger.kernel.org" , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-rdma@vger.kernel.org" , Paul Rosswurm Subject: Re: [EXTERNAL] Re: [PATCH V2 net-next] net: mana: Assigning IRQ affinity on HT cores Message-ID: <20231129222409.GB20858@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> References: <1700574877-6037-1-git-send-email-schakrabarti@linux.microsoft.com> <20231121154841.7fc019c8@kernel.org> <44a4e759-02fc-4015-90a8-c41eb7cb3dc1@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <44a4e759-02fc-4015-90a8-c41eb7cb3dc1@gmail.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Status: No, score=-8.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Wed, 29 Nov 2023 14:25:50 -0800 (PST) On Mon, Nov 27, 2023 at 11:07:31AM -0800, Florian Fainelli wrote: > On 11/27/23 01:36, Souradeep Chakrabarti wrote: > > > > > >>-----Original Message----- > >>From: Jakub Kicinski > >>Sent: Wednesday, November 22, 2023 5:19 AM > >>To: Souradeep Chakrabarti > >>Cc: KY Srinivasan ; Haiyang Zhang > >>; wei.liu@kernel.org; Dexuan Cui > >>; davem@davemloft.net; edumazet@google.com; > >>pabeni@redhat.com; Long Li ; > >>sharmaajay@microsoft.com; leon@kernel.org; cai.huoqing@linux.dev; > >>ssengar@linux.microsoft.com; vkuznets@redhat.com; tglx@linutronix.de; linux- > >>hyperv@vger.kernel.org; netdev@vger.kernel.org; linux-kernel@vger.kernel.org; > >>linux-rdma@vger.kernel.org; Souradeep Chakrabarti > >>; Paul Rosswurm > >>Subject: [EXTERNAL] Re: [PATCH V2 net-next] net: mana: Assigning IRQ affinity on > >>HT cores > >> > >>On Tue, 21 Nov 2023 05:54:37 -0800 Souradeep Chakrabarti wrote: > >>>Existing MANA design assigns IRQ to every CPUs, including sibling > >>>hyper-threads in a core. This causes multiple IRQs to work on same CPU > >>>and may reduce the network performance with RSS. > >>> > >>>Improve the performance by adhering the configuration for RSS, which > >>>assigns IRQ on HT cores. > >> > >>Drivers should not have to carry 120 LoC for something as basic as spreading IRQs. > >>Please take a look at include/linux/topology.h and if there's nothing that fits your > >>needs there - add it. That way other drivers can reuse it. > >Because of the current design idea, it is easier to keep things inside > >the mana driver code here. As the idea of IRQ distribution here is : > >1)Loop through interrupts to assign CPU > >2)Find non sibling online CPU from local NUMA and assign the IRQs > >on them. > >3)If number of IRQs is more than number of non-sibling CPU in that > >NUMA node, then assign on sibling CPU of that node. > >4)Keep doing it till all the online CPUs are used or no more IRQs. > >5)If all CPUs in that node are used, goto next NUMA node with CPU. > >Keep doing 2 and 3. > >6) If all CPUs in all NUMA nodes are used, but still there are IRQs > >then wrap over from first local NUMA node and continue > >doing 2, 3 4 till all IRQs are assigned. > > You are describing the logic of what is done by the driver which is > not responding to Jakub's comment. His request is to consider coming > up with at least a somewhat usable and generic helper for other > drivers to use. > > This also begs the obvious question: why is all of this in the > kernel in the first place? What could not be accomplished by an > initramfs/ramdisk with minimal user-space responsible for parsing > the system node(s) topology and CPU and assign interrupts > accordingly? > > We all like when things "automagically" work but this is conflating > mechanism (supporting interrupt affinities) with policy (assigning > affinities based upon work load) and that never flies really well. > -- > Florian I have shared a proposed patch in my previous reply to put some part in topology.h. Regarding why we want to have this change in kernel rather than in user-space is because most user in Azure expects things to just work out of the box. It becomes difficult in Azure to adopt scripts in thousand of images in short time. To avoid such problems for customers, we try to have this changes in kernel.