From: Jason Baron <jbaron@akamai.com>
To: Eric Dumazet <edumazet@google.com>,
"David S. Miller" <davem@davemloft.net>
Cc: netdev <netdev@vger.kernel.org>,
Neal Cardwell <ncardwell@google.com>,
Yuchung Cheng <ycheng@google.com>,
Eric Dumazet <eric.dumazet@gmail.com>
Subject: Re: [PATCH net-next 5/6] tcp: allow one skb to be received per socket under memory pressure
Date: Fri, 15 May 2015 14:20:50 -0400 [thread overview]
Message-ID: <55563902.402@akamai.com> (raw)
In-Reply-To: <1431701638-24451-6-git-send-email-edumazet@google.com>
On 05/15/2015 10:53 AM, Eric Dumazet wrote:
> While testing tight tcp_mem settings, I found tcp sessions could be
> stuck because we do not allow even one skb to be received on them.
>
> By allowing one skb to be received, we introduce fairness and
> eventuallu force memory hogs to release their allocation.
>
> Signed-off-by: Eric Dumazet <edumazet@google.com>
> ---
> net/ipv4/tcp_input.c | 10 ++++++----
> 1 file changed, 6 insertions(+), 4 deletions(-)
>
> diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
> index 093779f7e893..f6763faf0a60 100644
> --- a/net/ipv4/tcp_input.c
> +++ b/net/ipv4/tcp_input.c
> @@ -4507,10 +4507,12 @@ static void tcp_data_queue(struct sock *sk, struct sk_buff *skb)
>
> if (eaten <= 0) {
> queue_and_out:
> - if (eaten < 0 &&
> - tcp_try_rmem_schedule(sk, skb, skb->truesize))
> - goto drop;
> -
> + if (eaten < 0) {
> + if (skb_queue_len(&sk->sk_write_queue) == 0)
I'm confused here. Isn't this about the sk->sk_receive_queue being
empty? Maybe a comment to help clarify?
> + sk_forced_mem_schedule(sk, skb->truesize);
> + else if (tcp_try_rmem_schedule(sk, skb, skb->truesize))
> + goto drop;
> + }
> eaten = tcp_queue_rcv(sk, skb, 0, &fragstolen);
> }
> tcp_rcv_nxt_update(tp, TCP_SKB_CB(skb)->end_seq);
The rest of the patches looked ok to me. Thanks for looking at this!
-Jason
next prev parent reply other threads:[~2015-05-15 18:20 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-15 14:53 [PATCH net-next 0/6] tcp: better handling of memory pressure Eric Dumazet
2015-05-15 14:53 ` [PATCH net-next 1/6] net: fix sk_mem_reclaim_partial() Eric Dumazet
2015-05-15 14:53 ` [PATCH net-next 2/6] tcp: rename sk_forced_wmem_schedule() to sk_forced_mem_schedule() Eric Dumazet
2015-05-15 14:53 ` [PATCH net-next 3/6] tcp: introduce tcp_under_memory_pressure() Eric Dumazet
2015-05-15 14:53 ` [PATCH net-next 4/6] tcp: fix behavior for epoll edge trigger Eric Dumazet
2015-05-15 14:53 ` [PATCH net-next 5/6] tcp: allow one skb to be received per socket under memory pressure Eric Dumazet
2015-05-15 18:20 ` Jason Baron [this message]
2015-05-15 18:22 ` Eric Dumazet
2015-05-15 14:53 ` [PATCH net-next 6/6] tcp: halves tcp_mem[] limits Eric Dumazet
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=55563902.402@akamai.com \
--to=jbaron@akamai.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=eric.dumazet@gmail.com \
--cc=ncardwell@google.com \
--cc=netdev@vger.kernel.org \
--cc=ycheng@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