Message ID | 20230814093528.117342-1-bigeasy@linutronix.de |
---|---|
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b824:0:b0:3f2:4152:657d with SMTP id z4csp2638413vqi; Mon, 14 Aug 2023 03:08:10 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGJfanD3tVRt4o4OP7p+q8oBwgF9TEKhgwLUYf0HQ/ivtpS9LS9ZGbM3Ef+b0XLwPARYX25 X-Received: by 2002:a05:6a00:14c7:b0:653:de9a:d933 with SMTP id w7-20020a056a0014c700b00653de9ad933mr9866092pfu.17.1692007689904; Mon, 14 Aug 2023 03:08:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692007689; cv=none; d=google.com; s=arc-20160816; b=H9nCOcvGpSkuM0X357Lg3IcwDiOxy9kSsSgozS1Gakm9BwNO6uMNsdy/M93VfzGdNF co8ICsyejwTcJIXeQY5K45uDHHO6/FP5JjO8mViPq70Xd25mP+fCsUkzeX4XuPYgfPWD jrzxNOfX80eMR8E0ft/I9dSOLiA9V6Sct3zztaYwlMYRI1JnPs2WHFhPugBjQeTMXaSJ StzEmn/5BrQJVhbHT2cPZTDwHBeuTv3ebloiHaAyv2+Sg8TignzU5gUKDtS1iXaRbme2 gOplaTJT33f8RCXZ5xraZby3iq1InEOQIc9HbCTdl4kZry11W6NOPxBV53DeiughAYo7 A8sQ== 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=wDVW2X/kzPPFWaFpw2MsMXWR8jxN0En7pupo5Sq/sCs=; fh=2pyIfdED9G98mwDI0/D7sov7sXjsVqLnEzmDbwLP6Lk=; b=yyVN+niVtBF0n5MeuIgL5T61Hy8EyQ9+G2c9/SQ1cwsXPoi1GmuTgecAnr0UsheAvb Ngt07ujDuA4VTUqy7EVZWQgOnZp7lBrFRsXcpflPkJ6wgaW3m5ln4YTAXvu3UdcX7Jlu GvTlH+WJ5R9DDbtXBxGIni0u+Z1L3WUDv2iSKvCfh40I1QZeEzdBLu7t456qP5VmLDfy lfJtSzcF1Rj7uNh7l6NshWC24dSpLnl237FL35s2o44HqoAHlA+9GVjtXco1JZzVZgUk R5NCO8/rM8MrKcOp7fVhMU1CAgxyapEpffMrUVeScFWu7zHMN9uPzySRVgoQ49nfyhXH 2G2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b="v4oi/bJN"; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=FM6XuTaH; 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=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x26-20020a63171a000000b00564a1dc05a2si7554081pgl.191.2023.08.14.03.07.56; Mon, 14 Aug 2023 03:08:09 -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=@linutronix.de header.s=2020 header.b="v4oi/bJN"; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=FM6XuTaH; 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=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233541AbjHNJf6 (ORCPT <rfc822;274620705z@gmail.com> + 99 others); Mon, 14 Aug 2023 05:35:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52208 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234824AbjHNJfj (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 14 Aug 2023 05:35:39 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CC105E6D; Mon, 14 Aug 2023 02:35:38 -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=1692005737; 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=wDVW2X/kzPPFWaFpw2MsMXWR8jxN0En7pupo5Sq/sCs=; b=v4oi/bJNr777l1WZGazzKyS4YU/tLHmCNHUUWG5GKUP7a0y5oYCN8BZTdmJnAC/+MoVXk8 W2RM1sr2+nK5i9mMuwn4b4RElQXm3Nkt78oBS40KozHsRA+w13gb8oVDc7/j+fjTWJUP7i XoRzXxuLMFIAqankKl5NBN+ThAT8nojl/8F90mg1vF5pPLjtFQBhaGZE8GgpDZXUqksjHx RHBlcEwyv+AE71uEPmquDjcb2YhdvMMkVhiRuS9yOa0NkyLU9zMqadthwat9FLJhRkkVSk 9MKbjJ74Wf4/0mGUD8Jps0a0XXkBg6ojNeSEfIM6YCpw7M6M0GpI5rYynMXz7Q== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1692005737; 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=wDVW2X/kzPPFWaFpw2MsMXWR8jxN0En7pupo5Sq/sCs=; b=FM6XuTaHslfIdVrKbJ9OGlS3tvk3rWm8nv03Z6U3MYcwvUG/oBoQ3R7Zy+tmfeo5eF2I2T gSSVsw3nFfHFFiBA== 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 <wander@redhat.com> Subject: [RFC PATCH net-next 0/2] net: Use SMP threads for backlog NAPI. Date: Mon, 14 Aug 2023 11:35:26 +0200 Message-Id: <20230814093528.117342-1-bigeasy@linutronix.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS autolearn=ham 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1774198655281994785 X-GMAIL-MSGID: 1774198655281994785 |
Series |
net: Use SMP threads for backlog NAPI.
|
|
Message
Sebastian Andrzej Siewior
Aug. 14, 2023, 9:35 a.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. Patch #1 creates per-CPU threads for the backlog NAPI. It follows the threaded NAPI model and solves the issue and simplifies the code. Patch #2 gets rid of the warning. Since the ksoftirqd changes the situtation isn't as bad as it was. Still, it would be better to keep it in the context where it originated. Sebastian
Comments
On Mon, 14 Aug 2023 11:35:26 +0200 Sebastian Andrzej Siewior wrote: > 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. Could you find a less invasive solution? backlog is used by veth == most containerized environments. This change has a very high risk of regression for a lot of people.
On Thu, 17 Aug 2023 15:16:12 +0200 Sebastian Andrzej Siewior wrote: > I've been looking at veth. In the xdp case it has its own NAPI instance. > In the non-xdp it uses backlog. This should be called from > ndo_start_xmit and user's write() so BH is off and interrupts are > enabled at this point and it should be kind of rate-limited. Couldn't we > bypass backlog in this case and deliver the packet directly to the > stack? The backlog in veth eats measurable percentage points of RPS of real workloads, and I think number of people looked at getting rid of it. So worthy goal for sure, but may not be a trivial fix. To my knowledge the two main problems are: - we don't want to charge the sending application the processing for both "sides" of the connection and all the switching costs. - we may get an AA deadlock if the packet ends up looping in any way. Or at least that's what I remember the problem being at 8am in the morning :) Adding Daniel and Martin to CC, Paolo would also know this better than me but I think he's AFK for the rest of the week.