From owner-freebsd-hackers@FreeBSD.ORG Tue Nov 22 09:59:25 2005 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 860AB16A41F; Tue, 22 Nov 2005 09:59:25 +0000 (GMT) (envelope-from kprokazov@s-v-r.net) Received: from globalmail.svr.net.ua (globalmail.svr.net.ua [212.113.40.42]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1DA2A43D6A; Tue, 22 Nov 2005 09:59:24 +0000 (GMT) (envelope-from kprokazov@s-v-r.net) Received: from [10.1.2.12] (helo=svr012) by globalmail.svr.net.ua with smtp (Exim 4.52) id 1EeUvr-0004bX-09; Tue, 22 Nov 2005 11:59:23 +0200 Message-ID: <0d8401c5ef4d$450fc9b0$0c02010a@svr012> From: "Konstantin Prokazoff" To: "John Baldwin" , References: <3.0.1.32.20051121044201.00aa1490@pop.redshift.com> <0bb401c5ee9d$79ac2c50$0c02010a@svr012> <200511211038.26937.jhb@freebsd.org> Date: Tue, 22 Nov 2005 12:12:39 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.3790.0 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0 X-Mailman-Approved-At: Tue, 22 Nov 2005 12:59:57 +0000 Cc: Subject: Re: poll()/select() X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Nov 2005 09:59:25 -0000 Now, have checking non-FAST handler. Have some interest moments, such as error codes, like: Short write: 0/15 (Programming error) Write to 137 (fdno) failed: Programming error Maybe server becomes overloaded? (4xE1, Xeon 3G) Best regards, Konstantin Prokazoff Center Of Excellence, S_V_R Ltd., Kyiv HQs, Ukraine Official business-partner & DevConnect member of Avaya Inc. Regional development & support center of Digium Inc. Tel. +38 044 594 1781, ext. 1038 Fax. +38 044 234 0455 ----- Original Message ----- From: "John Baldwin" To: Cc: "Konstantin Prokazoff" Sent: Monday, November 21, 2005 5:38 PM Subject: Re: poll()/select() > On Monday 21 November 2005 08:14 am, Konstantin Prokazoff wrote: > > Thanks for comment, > > > > I think, after kernel inspection, problem (maybe) in preemption. While > > syscall to poll or select holds sellock, and if another thread (process) > > tries to syscall or we have taken interrupt (where handler use > > selrecord/selwakeup too), kernel will deadlock. > > I have this situation cause to INTR_FAST interrupt handler in device > > driver for Digium's PCI board, which provides 4 T1/E1 interfaces. Problem > > 100% repetitive. > > Another way to avoid such deadlock - provide different kthread/ithreads > > for select/poll mechanism. > > You can't call selwakeup() from an INTR_FAST handler. Try removing INTR_FAST > and see if it fixes your issue. If you want to use INTR_FAST, then realize > that you can only use spin mutexes in your handler, and that any more > complicated work like selwakeup() that uses regular mutexes will have to be > deferred either by using a swi handler or dispatching a task to the Fast > taskqueue. > > -- > John Baldwin <>< http://www.FreeBSD.org/~jhb/ > "Power Users Use the Power to Serve" = http://www.FreeBSD.org