[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20150424.110744.1450285878142227065.davem@davemloft.net>
Date: Fri, 24 Apr 2015 11:07:44 -0400 (EDT)
From: David Miller <davem@...emloft.net>
To: eric.dumazet@...il.com
Cc: johunt@...mai.com, netdev@...r.kernel.org, edumazet@...gle.com,
ncardwell@...gle.com, ycheng@...gle.com
Subject: Re: [PATCH net] tcp: avoid looping in tcp_send_fin()
From: Eric Dumazet <eric.dumazet@...il.com>
Date: Thu, 23 Apr 2015 10:42:39 -0700
> From: Eric Dumazet <edumazet@...gle.com>
>
> Presence of an unbound loop in tcp_send_fin() had always been hard
> to explain when analyzing crash dumps involving gigantic dying processes
> with millions of sockets.
>
> Lets try a different strategy :
>
> In case of memory pressure, try to add the FIN flag to last packet
> in write queue, even if packet was already sent. TCP stack will
> be able to deliver this FIN after a timeout event. Note that this
> FIN being delivered by a retransmit, it also carries a Push flag
> given our current implementation.
>
> By checking sk_under_memory_pressure(), we anticipate that cooking
> many FIN packets might deplete tcp memory.
>
> In the case we could not allocate a packet, even with __GFP_WAIT
> allocation, then not sending a FIN seems quite reasonable if it allows
> to get rid of this socket, free memory, and not block the process from
> eventually doing other useful work.
>
> Signed-off-by: Eric Dumazet <edumazet@...gle.com>
This is really nice, and long overdue, so I'm going to apply this now.
Thanks Eric.
--
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