Message ID | 20230929162121.1822900-1-bigeasy@linutronix.de |
---|---|
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2a8e:b0:403:3b70:6f57 with SMTP id in14csp61052vqb; Fri, 29 Sep 2023 14:58:19 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGF4f0OD+N3IVAdpbUGRWdVUd+11pdeTD0KMF/UZ+MHvqlAxuk4lrzH1iOmKUByCr4KewoY X-Received: by 2002:a05:6a20:a109:b0:155:2359:2194 with SMTP id q9-20020a056a20a10900b0015523592194mr6383498pzk.46.1696024698775; Fri, 29 Sep 2023 14:58:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696024698; cv=none; d=google.com; s=arc-20160816; b=VCLn4hWOMi5ZqqWx8N1qgd/BCT/Mjigc4Hg0y55zDd+W3L4/8iqamuL3kvJ2WYXNRl QmHNQnMhXgi0VQzNJz/Fw3mGXbim2+KHdhxQeLzBub/zD0jddL/NkfVIXqZ6ItFXW46i fZaODzlvrn7tLnkBJ20o8oxLIagH1VJGRpo+V+g/fv3bukneBXO9cldTmdGuN8UMm6LJ E+VQkoZXk93qW8Tti444GVlQiGxmtIqvcQkl5Lx/Wc9f5pzlkbZMkTiW6NDejyaaCvgO OMWgfwKDiQks++5q9fiIha9uHD+77xbTpA50HurPdkedWbOOdo3gx3F5/AOx23CmrUaV OKNw== 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:dkim-signature:dkim-signature:from; bh=Pfy40HfW0rOpJbLp9/b9G4Tw0KUOebfRdechmC+0mdA=; fh=65wgB8+QjsoZD3PHXvl9iYRXyEVsXrPZ5r3t2arXhEg=; b=RbkltYIImuMG7saMUKCQVLDAc/jAn98sKtd7N3UiiSgM1coRgiiM6V/NEyklmgGS57 7VqCUJrmAeeeRSPFsxWQjJImOAtSIpImOakv1CoPN9UGWL3xwmhJPj/PBod2kDKqK8JQ zoDPd9wstGwRSoWAhA4NzkthOrEHFdQUb2Xt8gN7ABi2aR82dDR8Wb2KB0pBujfyCwF/ S5FCo4tPszTCxusFCXYfqvqVIvR4YOzVeksYCl2oyVBWqEbfefdvuW2LWqKLbVjZC1+C wGmS3YTNFOJB5DV2IxnA8PlZxzjQ9d7buy0JFpnoZaXjQKKNHbxY98PHEzKXkNCHUmAz 4QeA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=wLXAzFm9; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=PdNwR8qu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id y5-20020a056a001c8500b0068a52819fd2si20883340pfw.331.2023.09.29.14.58.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Sep 2023 14:58:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=wLXAzFm9; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=PdNwR8qu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id BF51A8037A9E; Fri, 29 Sep 2023 09:21:54 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233631AbjI2QVe (ORCPT <rfc822;pwkd43@gmail.com> + 20 others); Fri, 29 Sep 2023 12:21:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57570 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233606AbjI2QVc (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 29 Sep 2023 12:21:32 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4F9421A4; Fri, 29 Sep 2023 09:21:30 -0700 (PDT) From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1696004487; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Pfy40HfW0rOpJbLp9/b9G4Tw0KUOebfRdechmC+0mdA=; b=wLXAzFm9DNE3IK001s6BGy7aX+uVYsoCxDrs2NGf9JxmjkU3JAP1YPr2HQNcV3oE0anECk LEJfB4+lBmB9VokpzPfSCqyiB9bJ76FKghCNOhWTzyqdFaX6FwwCRPmHFMJaiHoATUsmIa P/9tEcHa8m/ZVcQxcaLhrFkBTKDgc2r4iD2fBrVO/v2JYdMGqQTgP2zASBMK81mXuIAFTL 8R0cMdOc6w4iAOGYS/gwm5OdzkfrNzCq8SQew54zkH6MHCorPBQcDjyqUiTwAE0REUD4xQ ExZPnP2VL9co2HGLiyEqtA3xe5eNsxVsbUnB6D57b8hvJSfTSaqml6/auWydfg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1696004487; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Pfy40HfW0rOpJbLp9/b9G4Tw0KUOebfRdechmC+0mdA=; b=PdNwR8qu/XS8Uos9j6mMejZBVzlKL4KAyye/CdS/ycC4jMGWhmF2WEMLYR9KjpqckLpHdq ve7nHhcR8TxoaWCw== To: linux-kernel@vger.kernel.org, netdev@vger.kernel.org Cc: "David S. Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@google.com>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>, Peter Zijlstra <peterz@infradead.org>, Thomas Gleixner <tglx@linutronix.de>, Wander Lairson Costa <hawk@kernel.org> Subject: [PATCH net-next 0/2] net: Use SMP threads for backlog NAPI (or optional). Date: Fri, 29 Sep 2023 18:20:18 +0200 Message-ID: <20230929162121.1822900-1-bigeasy@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, 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 agentk.vger.email Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Fri, 29 Sep 2023 09:21:54 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778410794499051243 X-GMAIL-MSGID: 1778410794499051243 |
Series |
net: Use SMP threads for backlog NAPI (or optional).
|
|
Message
Sebastian Andrzej Siewior
Sept. 29, 2023, 4:20 p.m. UTC
The RPS code and "deferred skb free" both send IPI/ function call to a remote CPU in which a softirq is raised. This leads to a warning on PREEMPT_RT because raising softiqrs from function call led to undesired behaviour in the past. I had duct tape in RT for the "deferred skb free" and Wander Lairson Costa reported the RPS case. Changes: - RFC…v1 https://lore.kernel.org/all/20230818092111.5d86e351@kernel.org - Patch #2 has been removed. Removing the warning is still an option. - There are two patches in the series: - Patch #1 always creates backlog threads - Patch #2 creates the backlog threads if requested at boot time, mandatory on PREEMPT_RT. So it is either or and I wanted to show how both look like. - The kernel test robot reported a performance regression with loopback (stress-ng --udp X --udp-ops Y) against the RFC version. The regression is now avoided by using local-NAPI if backlog processing is requested on the local CPU. Sebastian
Comments
On Fri, 29 Sep 2023 18:20:18 +0200 Sebastian Andrzej Siewior wrote: > - Patch #2 has been removed. Removing the warning is still an option. > > - There are two patches in the series: > - Patch #1 always creates backlog threads > - Patch #2 creates the backlog threads if requested at boot time, > mandatory on PREEMPT_RT. > So it is either or and I wanted to show how both look like. > > - The kernel test robot reported a performance regression with > loopback (stress-ng --udp X --udp-ops Y) against the RFC version. > The regression is now avoided by using local-NAPI if backlog > processing is requested on the local CPU. Not what we asked for, and it doesn't apply.
On 2023-10-04 15:46:09 [-0700], Jakub Kicinski wrote: > On Fri, 29 Sep 2023 18:20:18 +0200 Sebastian Andrzej Siewior wrote: > > - Patch #2 has been removed. Removing the warning is still an option. > > > > - There are two patches in the series: > > - Patch #1 always creates backlog threads > > - Patch #2 creates the backlog threads if requested at boot time, > > mandatory on PREEMPT_RT. > > So it is either or and I wanted to show how both look like. > > > > - The kernel test robot reported a performance regression with > > loopback (stress-ng --udp X --udp-ops Y) against the RFC version. > > The regression is now avoided by using local-NAPI if backlog > > processing is requested on the local CPU. > > Not what we asked for, and it doesn't apply. Apologies if I misunderstood. You said to make it optional which I did with the static key in the second patch of this series. The first patch is indeed not what we talked about I just to show what it would look like now that there is no "delay" for backlog-NAPI on the local CPU. If the optional part is okay then I can repost only that patch against current net-next. Sebastian
On Sat, 7 Oct 2023 17:59:57 +0200 Sebastian Andrzej Siewior wrote: > Apologies if I misunderstood. You said to make it optional which I did > with the static key in the second patch of this series. The first patch > is indeed not what we talked about I just to show what it would look > like now that there is no "delay" for backlog-NAPI on the local CPU. > > If the optional part is okay then I can repost only that patch against > current net-next. Do we have reason to believe nobody uses RPS?
Sorry, getting back that late, I was traveling the last two weeks… On 2023-10-09 18:09:37 [-0700], Jakub Kicinski wrote: > On Sat, 7 Oct 2023 17:59:57 +0200 Sebastian Andrzej Siewior wrote: > > Apologies if I misunderstood. You said to make it optional which I did > > with the static key in the second patch of this series. The first patch > > is indeed not what we talked about I just to show what it would look > > like now that there is no "delay" for backlog-NAPI on the local CPU. > > > > If the optional part is okay then I can repost only that patch against > > current net-next. > > Do we have reason to believe nobody uses RPS? Not sure what you relate to. I would assume that RPS is used in general on actual devices and not on loopback where backlog is used. But it is just an assumption. The performance drop, which I observed with RPS and stress-ng --udp, is within the same range with threads and IPIs (based on memory). I can re-run the test and provide actual numbers if you want. Sebastian
On Mon, 16 Oct 2023 11:53:21 +0200 Sebastian Andrzej Siewior wrote: > > Do we have reason to believe nobody uses RPS? > > Not sure what you relate to. I would assume that RPS is used in general > on actual devices and not on loopback where backlog is used. But it is > just an assumption. > The performance drop, which I observed with RPS and stress-ng --udp, is > within the same range with threads and IPIs (based on memory). I can > re-run the test and provide actual numbers if you want. I was asking about RPS because with your current series RPS processing is forced into threads. IDK how well you can simulate the kind of workload which requires RPS. I've seen it used mostly on proxyies and gateways. For proxies Meta's experiments with threaded NAPI show regressions across the board. So "force-threading" RPS will most likely also cause regressions.
On 2023-10-16 07:17:56 [-0700], Jakub Kicinski wrote: > On Mon, 16 Oct 2023 11:53:21 +0200 Sebastian Andrzej Siewior wrote: > > > Do we have reason to believe nobody uses RPS? > > > > Not sure what you relate to. I would assume that RPS is used in general > > on actual devices and not on loopback where backlog is used. But it is > > just an assumption. > > The performance drop, which I observed with RPS and stress-ng --udp, is > > within the same range with threads and IPIs (based on memory). I can > > re-run the test and provide actual numbers if you want. > > I was asking about RPS because with your current series RPS processing > is forced into threads. IDK how well you can simulate the kind of > workload which requires RPS. I've seen it used mostly on proxyies > and gateways. For proxies Meta's experiments with threaded NAPI show > regressions across the board. So "force-threading" RPS will most likely > also cause regressions. Understood. Wandere/ Juri: Do you have any benchmark/ workload where you would see whether RPS with IPI (now) vs RPS (this patch) shows any regression? Sebastian
On 2023-10-16 16:53:39 [+0200], To Jakub Kicinski wrote: > On 2023-10-16 07:17:56 [-0700], Jakub Kicinski wrote: > > On Mon, 16 Oct 2023 11:53:21 +0200 Sebastian Andrzej Siewior wrote: > > > > Do we have reason to believe nobody uses RPS? > > > > > > Not sure what you relate to. I would assume that RPS is used in general > > > on actual devices and not on loopback where backlog is used. But it is > > > just an assumption. > > > The performance drop, which I observed with RPS and stress-ng --udp, is > > > within the same range with threads and IPIs (based on memory). I can > > > re-run the test and provide actual numbers if you want. > > > > I was asking about RPS because with your current series RPS processing > > is forced into threads. IDK how well you can simulate the kind of > > workload which requires RPS. I've seen it used mostly on proxyies > > and gateways. For proxies Meta's experiments with threaded NAPI show > > regressions across the board. So "force-threading" RPS will most likely > > also cause regressions. > > Understood. > > Wandere/ Juri: Do you have any benchmark/ workload where you would see > whether RPS with IPI (now) vs RPS (this patch) shows any regression? So I poked offlist other RH people and I've been told that they hardly ever test RPS since the NICs these days have RSS in hardware. Sebastian
On Tue, Oct 31, 2023 at 7:14 AM Sebastian Andrzej Siewior <bigeasy@linutronix.de> wrote: > > On 2023-10-16 16:53:39 [+0200], To Jakub Kicinski wrote: > > On 2023-10-16 07:17:56 [-0700], Jakub Kicinski wrote: > > > On Mon, 16 Oct 2023 11:53:21 +0200 Sebastian Andrzej Siewior wrote: > > > > > Do we have reason to believe nobody uses RPS? > > > > > > > > Not sure what you relate to. I would assume that RPS is used in general > > > > on actual devices and not on loopback where backlog is used. But it is > > > > just an assumption. > > > > The performance drop, which I observed with RPS and stress-ng --udp, is > > > > within the same range with threads and IPIs (based on memory). I can > > > > re-run the test and provide actual numbers if you want. > > > > > > I was asking about RPS because with your current series RPS processing > > > is forced into threads. IDK how well you can simulate the kind of > > > workload which requires RPS. I've seen it used mostly on proxyies > > > and gateways. For proxies Meta's experiments with threaded NAPI show > > > regressions across the board. So "force-threading" RPS will most likely > > > also cause regressions. > > > > Understood. > > > > Wandere/ Juri: Do you have any benchmark/ workload where you would see > > whether RPS with IPI (now) vs RPS (this patch) shows any regression? > > So I poked offlist other RH people and I've been told that they hardly > ever test RPS since the NICs these days have RSS in hardware. Sorry, Juri is in PTO and I am just back from sick leave and still catching up. I've been contacting some QE people, but so far it is like you said, no stress test for RPS. If I have some news, I let you know. > > Sebastian >