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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Fri, 15 May 2015 11:22:50 -0700
From:	Eric Dumazet <eric.dumazet@...il.com>
To:	Jason Baron <jbaron@...mai.com>
Cc:	Eric Dumazet <edumazet@...gle.com>,
	"David S. Miller" <davem@...emloft.net>,
	netdev <netdev@...r.kernel.org>,
	Neal Cardwell <ncardwell@...gle.com>,
	Yuchung Cheng <ycheng@...gle.com>
Subject: Re: [PATCH net-next 5/6] tcp: allow one skb to be received per
 socket under memory pressure

On Fri, 2015-05-15 at 14:20 -0400, Jason Baron wrote:
> 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?

Arg you are right of course !

I'll use the proper queue in v2.

Note that only in order packets are going to use this, not out of order
ones.

Thanks


--
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