netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH RFC] net: decrease the length of backlog queue immediately after it's detached from sk
@ 2016-03-30  5:16 Yang Yingliang
  2016-03-30  5:25 ` Eric Dumazet
  2016-03-30 12:56 ` Sergei Shtylyov
  0 siblings, 2 replies; 21+ messages in thread
From: Yang Yingliang @ 2016-03-30  5:16 UTC (permalink / raw)
  To: netdev; +Cc: davem, eric.dumazet

When task A hold the sk owned in tcp_sendmsg, if lots of packets
arrive and the packets will be added to backlog queue. The packets
will be handled in release_sock called from tcp_sendmsg. When the
sk_backlog is removed from sk, the length will not decrease until
all the packets in backlog queue are handled. This may leads to the
new packets be dropped because the lenth is too big. So set the
lenth to 0 immediately after it's detached from sk.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
---
 net/core/sock.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/net/core/sock.c b/net/core/sock.c
index 47fc8bb..108be05 100644
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -1933,6 +1933,7 @@ static void __release_sock(struct sock *sk)
 
 	do {
 		sk->sk_backlog.head = sk->sk_backlog.tail = NULL;
+		sk->sk_backlog.len = 0;
 		bh_unlock_sock(sk);
 
 		do {
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2016-04-13  2:42 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-30  5:16 [PATCH RFC] net: decrease the length of backlog queue immediately after it's detached from sk Yang Yingliang
2016-03-30  5:25 ` Eric Dumazet
2016-03-30  5:34   ` Eric Dumazet
2016-03-30  5:56     ` Yang Yingliang
2016-03-30 13:47       ` Eric Dumazet
2016-04-07  5:59         ` Yang Yingliang
2016-04-07 10:21           ` Eric Dumazet
2016-04-07 14:51             ` Eric Dumazet
2016-04-08 11:18               ` Yang Yingliang
2016-04-08 14:44                 ` Eric Dumazet
2016-04-08 16:53                   ` David Miller
2016-04-08 17:04                     ` Eric Dumazet
2016-04-11 14:42                       ` Yang Yingliang
2016-04-11 11:57                   ` Yang Yingliang
2016-04-11 12:13                     ` Eric Dumazet
2016-04-12  2:59                       ` Yang Yingliang
2016-04-12 12:31                         ` Yang Yingliang
2016-04-13  2:42                           ` Eric Dumazet
2016-03-30  5:38   ` Yang Yingliang
2016-03-30 12:56 ` Sergei Shtylyov
2016-04-07  6:01   ` Yang Yingliang

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