From: Eric Dumazet <eric.duma...@gmail.com> Date: Thu, 23 Apr 2015 10:42:39 -0700
> From: Eric Dumazet <eduma...@google.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 <eduma...@google.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 majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html