Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp141404rwl; Fri, 24 Mar 2023 22:59:56 -0700 (PDT) X-Google-Smtp-Source: AKy350YCsOGPKVuklHxggPSN9e//f+zTn6gKcxTRDzW0yB2FNHcBooSZJ3hfzfxsTmhCzry9id3Y X-Received: by 2002:a17:902:f550:b0:1a1:b8cc:59da with SMTP id h16-20020a170902f55000b001a1b8cc59damr7506325plf.33.1679723995840; Fri, 24 Mar 2023 22:59:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679723995; cv=none; d=google.com; s=arc-20160816; b=WioFya8dYGC/K5waA6xz8NmY/Iu13HaHzplodINMiyEcafhb29PR0YEm2hrSxMzjCV MKIFf/pnsCh++6npHKBcX9BEofe7R3qwflpnTli7pJ2th2DjI5m0XWNUF2pPB5qFUv0C 3gTsxDdyvrGJzl1B8W/nOCI5+/l7rKNzmMSdVPaNoy5oCKKnklt7TVMRn08lWqxFN+y6 uFsPARICivtGJYxUGc61xcSmYw1kMzkGMjMc0GgbRsAwCDOB1Ev2jDVIP+TAZyLWywoE tQCPMsCL49kSyN2IM0jMjWm4+bFZ36QR5lq0ZVzoZ9NSknKzgAHPZ/oVrpHItWvqFZnV tbWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=elBC7x8BCDuYhJTGwQV3bWcb2ZYFxDKqqBJRBK7oPXA=; b=p0fdQqDDL/26js3rd8FqaGoCehArdeYeoPcFT6SeNoqxfpDXlYIz6Hng+SjS7DZVoN 6KGIT5oZf/s+LY1+Q3UXA1EvZ0A0E3jrXSXZxCVbasKg/lEMhb8LtTasU5DiHtv8LqoL c7n21zKTDQ8opNm3TZAFIb1oXKA5Wbw2ivZl6j8vkR6BQFWHYlicGoVXOOCEe0XBhZQL rwHRwxtvU51NXM4nQjBU+4uJ8McXcSGERcZkMJKp1S+Csy1wjdajpZN/hcrJAMvuZluW ZTP9YMyy1d09vXknWZ5Lv00IJwp4GHkvDfAf0O0BMA1roYyyqmwvjp1YW+AaGNhUGHRM Q/mQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b=MfYdNUge; 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=fail (p=NONE sp=NONE dis=NONE) header.from=nbd.name Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id kj8-20020a17090306c800b001a1d6a9c6f1si13334239plb.124.2023.03.24.22.59.33; Fri, 24 Mar 2023 22:59:55 -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=fail header.i=@nbd.name header.s=20160729 header.b=MfYdNUge; 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=fail (p=NONE sp=NONE dis=NONE) header.from=nbd.name Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231871AbjCYFmz (ORCPT + 99 others); Sat, 25 Mar 2023 01:42:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58880 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229441AbjCYFmy (ORCPT ); Sat, 25 Mar 2023 01:42:54 -0400 Received: from nbd.name (nbd.name [46.4.11.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5AC481A48C; Fri, 24 Mar 2023 22:42:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=nbd.name; s=20160729; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From: References:Cc:To:Subject:MIME-Version:Date:Message-ID:Sender:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=elBC7x8BCDuYhJTGwQV3bWcb2ZYFxDKqqBJRBK7oPXA=; b=MfYdNUgeY+5US8ue8eoYcRVIyp vlkWGh2XrS2isG+R+p58i3KZxlnLWqJjzhedN9Jf7elWGTXCi6YBUYXreMyqPgI+DY5Z1mfZbupQM 0R8dKbj7amqnvFhHKCV3RLxq7oqHwLKThyDEZnC0Xe9JiSsvVmtMq3xxx41IxE15K1ak=; Received: from p54ae9730.dip0.t-ipconnect.de ([84.174.151.48] helo=nf.local) by ds12 with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1pfwfr-006bjW-Us; Sat, 25 Mar 2023 06:42:44 +0100 Message-ID: <2ef8ab92-3670-61a1-384d-b827865447ca@nbd.name> Date: Sat, 25 Mar 2023 06:42:43 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.9.0 Subject: Re: [PATCH net-next] net/core: add optional threading for backlog processing Content-Language: en-US To: Jakub Kicinski Cc: netdev@vger.kernel.org, Jonathan Corbet , "David S. Miller" , Eric Dumazet , Paolo Abeni , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org References: <20230324171314.73537-1-nbd@nbd.name> <20230324102038.7d91355c@kernel.org> <2d251879-1cf4-237d-8e62-c42bb4feb047@nbd.name> <20230324104733.571466bc@kernel.org> <20230324201951.75eabe1f@kernel.org> From: Felix Fietkau In-Reply-To: <20230324201951.75eabe1f@kernel.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,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 On 25.03.23 04:19, Jakub Kicinski wrote: > 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. I didn't actually run any tests on bigger systems myself, so I don't know how to tune it for those. >> >> 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? In this test I'm using threaded NAPI and backlog_threaded without any fixed core assignment. - Felix