netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jason Xing <kerneljasonxing@gmail.com>
To: davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
	pabeni@redhat.com, horms@kernel.org
Cc: netdev@vger.kernel.org, Jason Xing <kernelxing@tencent.com>
Subject: [RFC PATCH net-next] net: add an entry for CONFIG_NET_RX_BUSY_POLL
Date: Tue, 23 Jul 2024 21:57:42 +0800	[thread overview]
Message-ID: <20240723135742.35102-1-kerneljasonxing@gmail.com> (raw)

From: Jason Xing <kernelxing@tencent.com>

When I was doing performance test on unix_poll(), I found out that
accessing sk->sk_ll_usec when calling sock_poll()->sk_can_busy_loop()
occupies too much time, which causes around 16% degradation. So I
decided to turn off this config, which cannot be done apparently
before this patch.

Signed-off-by: Jason Xing <kernelxing@tencent.com>
---
More data not much related if you're interested:
  5.82 │      mov   0x18(%r13),%rdx
  0.03 │      mov   %rsi,%r12
  1.76 │      mov   %rdi,%rbx
       │    sk_can_busy_loop():
  0.50 │      mov   0x104(%rdx),%r14d
 41.30 │      test  %r14d,%r14d
Note: I run 'perf record -e  L1-dcache-load-misses' to diagnose
---
 net/Kconfig | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/net/Kconfig b/net/Kconfig
index d27d0deac0bf..1f1b793984fe 100644
--- a/net/Kconfig
+++ b/net/Kconfig
@@ -335,8 +335,10 @@ config CGROUP_NET_CLASSID
 	  being used in cls_cgroup and for netfilter matching.
 
 config NET_RX_BUSY_POLL
-	bool
+	bool "Low latency busy poll timeout"
 	default y if !PREEMPT_RT || (PREEMPT_RT && !NETCONSOLE)
+	help
+	  Approximate time in us to spin waiting for packets on the device queue.
 
 config BQL
 	bool
-- 
2.37.3


             reply	other threads:[~2024-07-23 13:57 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-23 13:57 Jason Xing [this message]
2024-07-23 14:57 ` [RFC PATCH net-next] net: add an entry for CONFIG_NET_RX_BUSY_POLL Eric Dumazet
2024-07-23 15:09   ` Jason Xing
2024-07-23 15:12     ` Jason Xing
2024-07-23 15:26       ` Eric Dumazet
2024-07-23 16:00         ` Jason Xing
2024-07-23 16:28           ` Eric Dumazet
2024-07-24  0:38             ` Jason Xing
2024-07-24  0:55               ` Jason Xing
2024-07-24  7:33               ` Jason Xing
2024-07-24  8:54                 ` Eric Dumazet
2024-07-24  9:01                   ` Jason Xing

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240723135742.35102-1-kerneljasonxing@gmail.com \
    --to=kerneljasonxing@gmail.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=kernelxing@tencent.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).