Potential deadlock on mbuf

Alexandre Martins alexandre.martins at netasq.com
Mon Apr 2 16:21:39 UTC 2012


Dear,

I have currently having troubles with a basic socket stress.

The socket are setup to use non-blocking I/O.

During this stress-test, the kernel is running mbuf exhaustion, the goal is to 
see system limits.

If the program make a write on a socket during this mbuf exhaustion, it become 
blocked in "write" system call. The status of the process is "zonelimit" and 
whole network I/O fall in timeout.

I have found the root cause of the block  :
http://svnweb.freebsd.org/base/head/sys/kern/uipc_socket.c?view=markup#l1279

So, the question is : Why m_uiotombuf is called with a blocking parameter 
(M_WAITOK) even if is for a non-blocking socket ?

Then, if M_NOWAIT is used, maybe it will be usefull to have an 'ENOMEM' error.

Regards

-- 
Alexandre Martins



More information about the freebsd-current mailing list