diff options
| author | Eric Dumazet <[email protected]> | 2024-03-28 14:40:32 +0000 |
|---|---|---|
| committer | Jakub Kicinski <[email protected]> | 2024-03-29 22:03:11 +0000 |
| commit | 1abe267f173eae7ae76cf56232292e9641eb652f (patch) | |
| tree | b8f7952bdc3936448e9ee4da907745b2f9c1a7f8 /net/ipv4/udp.c | |
| parent | udp: avoid calling sock_def_readable() if possible (diff) | |
| download | kernel-1abe267f173eae7ae76cf56232292e9641eb652f.tar.gz kernel-1abe267f173eae7ae76cf56232292e9641eb652f.zip | |
net: add sk_wake_async_rcu() helper
While looking at UDP receive performance, I saw sk_wake_async()
was no longer inlined.
This matters at least on AMD Zen1-4 platforms (see SRSO)
This might be because rcu_read_lock() and rcu_read_unlock()
are no longer nops in recent kernels ?
Add sk_wake_async_rcu() variant, which must be called from
contexts already holding rcu lock.
As SOCK_FASYNC is deprecated in modern days, use unlikely()
to give a hint to the compiler.
sk_wake_async_rcu() is properly inlined from
__udp_enqueue_schedule_skb() and sock_def_readable().
Signed-off-by: Eric Dumazet <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jakub Kicinski <[email protected]>
Diffstat (limited to 'net/ipv4/udp.c')
| -rw-r--r-- | net/ipv4/udp.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c index 143043cd2dcb..11460d751e73 100644 --- a/net/ipv4/udp.c +++ b/net/ipv4/udp.c @@ -1544,7 +1544,7 @@ int __udp_enqueue_schedule_skb(struct sock *sk, struct sk_buff *skb) INDIRECT_CALL_1(sk->sk_data_ready, sock_def_readable, sk); else - sk_wake_async(sk, SOCK_WAKE_WAITD, POLL_IN); + sk_wake_async_rcu(sk, SOCK_WAKE_WAITD, POLL_IN); } busylock_release(busy); return 0; |
