lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <55563902.402@akamai.com>
Date:	Fri, 15 May 2015 14:20:50 -0400
From:	Jason Baron <jbaron@...mai.com>
To:	Eric Dumazet <edumazet@...gle.com>,
	"David S. Miller" <davem@...emloft.net>
CC:	netdev <netdev@...r.kernel.org>,
	Neal Cardwell <ncardwell@...gle.com>,
	Yuchung Cheng <ycheng@...gle.com>,
	Eric Dumazet <eric.dumazet@...il.com>
Subject: Re: [PATCH net-next 5/6] tcp: allow one skb to be received per socket
 under memory pressure

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@...gle.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
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ