From owner-freebsd-current@FreeBSD.ORG Mon Apr 2 16:21:39 2012 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4C4791065670 for ; Mon, 2 Apr 2012 16:21:39 +0000 (UTC) (envelope-from alexandre.martins@netasq.com) Received: from work.netasq.com (gateway.netasq.com [91.212.116.2]) by mx1.freebsd.org (Postfix) with ESMTP id DED218FC0C for ; Mon, 2 Apr 2012 16:21:38 +0000 (UTC) Received: from pc-alex.netasq.com (unknown [10.2.40.253]) by work.netasq.com (Postfix) with ESMTPS id BADAE740019 for ; Mon, 2 Apr 2012 18:21:27 +0200 (CEST) From: Alexandre Martins Organization: NETASQ To: freebsd-current@freebsd.org Date: Mon, 2 Apr 2012 18:21:37 +0200 User-Agent: KMail/1.13.7 (FreeBSD/8.2-RELEASE; KDE/4.7.4; amd64; ; ) MIME-Version: 1.0 Content-Type: Text/Plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Message-Id: <201204021821.37437.alexandre.martins@netasq.com> Subject: Potential deadlock on mbuf X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Apr 2012 16:21:39 -0000 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