Subject: Re: [RFC][PATCH 0/9] Network receive deadlock prevention for NBD

From: Rik van Riel <[email-masked]>
Date: Sat, 12 Aug 2006 21:11:16 -0400

David Miller wrote:
> From: Peter Zijlstra <[email-masked]>
> Date: Sat, 12 Aug 2006 12:18:07 +0200
> 
>> 65535 sockets * 128 packets * 16384 bytes/packet = 
>> 1^16 * 1^7 * 1^14 = 1^(16+7+14) = 1^37 = 128G of memory per IP
>>
>> And systems with a lot of IP numbers are not unthinkable.
> 
> TCP restricts the amount of global memory that may be consumed
> by all TCP sockets via the tcp_mem[] sysctl.

This is exactly why we need to be careful which sockets
we allocate memory for, when the system is about to run
out of memory.

-- 
"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it." - Brian W. Kernighan