Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp43026rwl; Fri, 24 Mar 2023 20:29:36 -0700 (PDT) X-Google-Smtp-Source: AKy350aNZfJ06CwFPTP3G/sAKY1LzlJbL7yz2SERUrs5/YNljsiuqrz291B/2esl87nSvRBJZsFT X-Received: by 2002:a17:906:25d1:b0:8b1:3131:76e9 with SMTP id n17-20020a17090625d100b008b1313176e9mr4863209ejb.46.1679714976276; Fri, 24 Mar 2023 20:29:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679714976; cv=none; d=google.com; s=arc-20160816; b=LUNDIkPy/8QiKEqk80JjW0Kr9rWsBTGJmLvLWuSxB+ZRkwQPS5i3oGQUEoCrfHO+6g eDAUtxcK1YzAu1Givt1IdgGnXyP/Oq4/NGV1DbBVcvnOOO5HdeRSz9dC3V8wLcEGNeez /muuuPUtOOCcK1lRu/l6QosGu429FQratFdUi1+0bFAzx4xbJUbc4Lf2ipT09cffQ/PF XUPBj3HC+4EWAUU96uLTfgtNxF7nPUO8k8qDoMwVskndh6MIAM+nd/vhkVdWqra9lfCz p5uCf6UKyLkonGFYUDaMb9qHYTstPp42YphVPmNipeNRmqV8pE+7Qg/xvkD6vFH6lfhz 7+VQ== 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 :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=Y61K/+IxDZauxMUmN2yEYAs+9eRSk8Z/PZZ5mxg4ZXA=; b=qRQfSmza8D19MR+8kELMdGlG0EIV7Sk3Ja8bjqOycFNOx+GQ81pVN1BLfarbJSmOt+ Zy7gKL0G4AGBinJ7bcuONtBHDKLA4vcyMkDad93K+FhjLTZn+n4dFGNLfVN0/vUE5FNe GQauKdetL063j9Cj671HwBAwwCjweOb8RFkZsQcKqwA95PXIdGB7/Tf/fy1FaWkah7d0 e78yaejtNKyvCAGQWBIW5aitLpILHl5b51oW5qLYBGmlM5pGKTJbQOiJy4TuCqD2oWoF U4nrroyiG0I3cZK42uj862bUDPdpiJiXktUiyyXUquz6xyyPQIC1DoWdyJdw5cCQA3SL DzRQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=oWS0Cam7; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n1-20020a1709062bc100b008b179adfaf5si20949354ejg.466.2023.03.24.20.29.11; Fri, 24 Mar 2023 20:29: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=@kernel.org header.s=k20201202 header.b=oWS0Cam7; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231513AbjCYDT4 (ORCPT + 99 others); Fri, 24 Mar 2023 23:19:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55224 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229441AbjCYDTy (ORCPT ); Fri, 24 Mar 2023 23:19:54 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0F037BDEF; Fri, 24 Mar 2023 20:19:53 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 927AF62D1D; Sat, 25 Mar 2023 03:19:53 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9BDBFC433EF; Sat, 25 Mar 2023 03:19:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1679714393; bh=d23nvSOJc744ejl12OeHq0eftBnWlz8O/pBXnLBn3fA=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=oWS0Cam7J3f/odv+g/GiiJEfwnIRPL57QfLCGxusvohO5Jd6M2Q4yf75m1N83wc7d LspKJj9HVw0UqS6BNcyq0q/Cyn0dzsQsUDme5tPa5ROgvNKF8eOf4KX0T1vGghydn2 oVOPs9jJ7NNqQUvrWEwa8s3RT8j4ZhGiFhUn4ju4I5k9fre4ixmoHKax7b57Rfhzlp tD5dPdleXcMRVk41F+Kln5WwcLtdVkalpYlOVCKjrkmX6Ku6RdWlo+BdGmX0f9IBG6 Oa13cOLYgaY3gy0lXGBtfRBNS90U6sZzM/sHXcnR56pgpLjZu7ZsCRFDjE2S7rdOLn RXZmGy7ZMtpmw== Date: Fri, 24 Mar 2023 20:19:51 -0700 From: Jakub Kicinski To: Felix Fietkau Cc: netdev@vger.kernel.org, Jonathan Corbet , "David S. Miller" , Eric Dumazet , Paolo Abeni , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH net-next] net/core: add optional threading for backlog processing Message-ID: <20230324201951.75eabe1f@kernel.org> In-Reply-To: References: <20230324171314.73537-1-nbd@nbd.name> <20230324102038.7d91355c@kernel.org> <2d251879-1cf4-237d-8e62-c42bb4feb047@nbd.name> <20230324104733.571466bc@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-5.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI,SPF_HELO_NONE, SPF_PASS 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 On Fri, 24 Mar 2023 18:57:03 +0100 Felix Fietkau wrote: > >> It can basically be used to make RPS a bit more dynamic and > >> configurable, because you can assign multiple backlog threads to a set > >> of CPUs and selectively steer packets from specific devices / rx queues > > > > Can you give an example? > > > > With the 4 CPU example, in case 2 queues are very busy - you're trying > > to make sure that the RPS does not end up landing on the same CPU as > > the other busy queue? > > In this part I'm thinking about bigger systems where you want to have a > group of CPUs dedicated to dealing with network traffic without > assigning a fixed function (e.g. NAPI processing or RPS target) to each > one, allowing for more dynamic processing. I tried the threaded NAPI on larger systems and helped others try, and so far it's not been beneficial :( Even the load balancing improvements are not significant enough to use it, and there is a large risk of scheduler making the wrong decision. Hence my questioning - I'm trying to understand what you're doing differently. > >> to them and allow the scheduler to take care of the rest. > > > > You trust the scheduler much more than I do, I think :) > > In my tests it brings down latency (both avg and p99) considerably in > some cases. I posted some numbers here: > https://lore.kernel.org/netdev/e317d5bc-cc26-8b1b-ca4b-66b5328683c4@nbd.name/ Could you provide the full configuration for this test? In non-threaded mode the RPS is enabled to spread over remaining 3 cores?