When using network attached storage, Linux and other OSes are vulnerable to a fundamental deadlock problem. The premise of the problem is that one may need memory in order to free memory, and freeing memory is done mostly when there is very little free memory left.
The problem can happen with normally written files, MAP_SHARED mmaped files and swap, but is most likely to happen with the latter two. It can hit with NFS, iSCSI, AoE or any other network storage protocol, since they all rely on the network layer.
The bug can get triggered as follows: # the system is low on free memory
# writing pages back to storage over network requires allocating memory
# kswapd can get this memory, because it has higher priority and the system sets aside something extra for the pageout code # now the system is really low on memory, it may even have no free memory left at all # the NAS appliance receives the write request from the computer
# however, at this point the OS may not have any memory left to receive these packets from the NAS # the OS never knows whether the I/O has completed, since it cannot receive any more network packets # the computer deadlocks