From owner-freebsd-questions@FreeBSD.ORG Sat Feb 5 21:54:06 2011 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A7A771065693 for ; Sat, 5 Feb 2011 21:54:06 +0000 (UTC) (envelope-from freebsd-questions@m.gmane.org) Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by mx1.freebsd.org (Postfix) with ESMTP id 2E4F18FC18 for ; Sat, 5 Feb 2011 21:54:05 +0000 (UTC) Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1Plq4x-0005lj-5K for freebsd-questions@freebsd.org; Sat, 05 Feb 2011 22:54:03 +0100 Received: from cpe-188-129-80-149.dynamic.amis.hr ([188.129.80.149]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 05 Feb 2011 22:54:03 +0100 Received: from ivoras by cpe-188-129-80-149.dynamic.amis.hr with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 05 Feb 2011 22:54:03 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: freebsd-questions@freebsd.org From: Ivan Voras Date: Sat, 05 Feb 2011 22:53:46 +0100 Lines: 44 Message-ID: References: <8CD938986F06744-660-2F4AE@web-mmc-m06.sysops.aol.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: cpe-188-129-80-149.dynamic.amis.hr User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.12) Gecko/20101102 Thunderbird/3.1.6 In-Reply-To: <8CD938986F06744-660-2F4AE@web-mmc-m06.sysops.aol.com> Subject: Re: Why does printf(9) hang network? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Feb 2011 21:54:06 -0000 On 05/02/2011 21:22, dieterbsd@engineer.com wrote: > Why would doing a printf(9) in a device driver (usb, firewire, probably > others) cause an obscenely long lockout on > /usr/src/sys/kern/uipc_sockbuf.c:148 (sx:so_rcv_sx) ? You should ask this question on freebsd-hackers@. > > Printf(9) alone isn't the problem, adding printfs to chown(2) does not > cause the problem, but printfs from device drivers do. > > Grep says that uipc_sockbuf.c is the only file that locks/unlocks sb_sx. > The device drivers and printf don't even know that sb_sx exists. > > 135 int > 136 sblock(struct sockbuf *sb, int flags) > 137 { > 138 > 139 KASSERT((flags& SBL_VALID) == flags, > 140 ("sblock: flags invalid (0x%x)", flags)); > 141 > 142 if (flags& SBL_WAIT) { > 143 if ((sb->sb_flags& SB_NOINTR) || > 144 (flags& SBL_NOINTR)) { > 145 sx_xlock(&sb->sb_sx); > 146 return (0); > 147 } > 148 return (sx_xlock_sig(&sb->sb_sx)); > 149 } else { > 150 if (sx_try_xlock(&sb->sb_sx) == 0) > 151 return (EWOULDBLOCK); > 152 return (0); > 153 } > 154 } > > More info at: http://www.freebsd.org/cgi/query-pr.cgi?pr=118093 > > > _______________________________________________ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org" >