From: Eric Dumazet <eric.dumazet@gmail.com>
To: Eric Dumazet <edumazet@google.com>,
"David S . Miller" <davem@davemloft.net>
Cc: netdev <netdev@vger.kernel.org>,
Soheil Hassas Yeganeh <soheil@google.com>,
Willem de Bruijn <willemb@google.com>,
Florian Westphal <fw@strlen.de>,
Tom Herbert <tom@herbertland.com>
Subject: Re: [PATCH net-next 3/3] tcp: add one skb cache for rx
Date: Thu, 21 Mar 2019 15:52:23 -0700 [thread overview]
Message-ID: <e1e18821-cc85-b3ab-c9f5-9c06ec564fc9@gmail.com> (raw)
In-Reply-To: <20190321221750.176658-4-edumazet@google.com>
On 03/21/2019 03:17 PM, Eric Dumazet wrote:
> Often times, recvmsg() system calls and BH handling for a particular
> TCP socket are done on different cpus.
...
> Note that if rps/rfs is used, we do not enable this feature, because
> there is high chance that the same cpu is handling both the recvmsg()
> system call and the TCP rx path, but that another cpu did the skb
> allocations in the device driver right before the RPS/RFS logic.
>
> To properly handle this case, it seems we would need to record
> on which cpu skb was allocated, and use a different channel
> to give skbs back to this cpu.
Oops a rebase went wrong and I missed the following bit,
this will be added in v2.
diff --git a/include/net/sock.h b/include/net/sock.h
index a7e936ce5a5ac935d90c47f6dd68bf9e8e47ba10..0840f4b27b91eddb205ff42c03f787e5914f755d 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -2439,7 +2439,7 @@ static inline void skb_setup_tx_timestamp(struct sk_buff *skb, __u16 tsflags)
static inline void sk_eat_skb(struct sock *sk, struct sk_buff *skb)
{
__skb_unlink(skb, &sk->sk_receive_queue);
- if (!sk->sk_rx_skb_cache) {
+ if (!static_branch_unlikely(&rps_needed) && !sk->sk_rx_skb_cache) {
sk->sk_rx_skb_cache = skb;
skb_orphan(skb);
return;
next prev parent reply other threads:[~2019-03-21 22:52 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-21 22:17 [PATCH net-next 0/3] tcp: add rx/tx cache to reduce lock contention Eric Dumazet
2019-03-21 22:17 ` [PATCH net-next 1/3] net: convert rps_needed and rfs_needed to new static branch api Eric Dumazet
2019-03-22 16:01 ` kbuild test robot
2019-03-21 22:17 ` [PATCH net-next 2/3] tcp: add one skb cache for tx Eric Dumazet
2019-03-22 19:07 ` kbuild test robot
2019-03-21 22:17 ` [PATCH net-next 3/3] tcp: add one skb cache for rx Eric Dumazet
2019-03-21 22:52 ` Eric Dumazet [this message]
2019-03-21 22:25 ` [PATCH net-next 0/3] tcp: add rx/tx cache to reduce lock contention Soheil Hassas Yeganeh
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=e1e18821-cc85-b3ab-c9f5-9c06ec564fc9@gmail.com \
--to=eric.dumazet@gmail.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=fw@strlen.de \
--cc=netdev@vger.kernel.org \
--cc=soheil@google.com \
--cc=tom@herbertland.com \
--cc=willemb@google.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).