From owner-freebsd-hackers@FreeBSD.ORG Wed Nov 2 19:16:30 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 4F7B216A41F for ; Wed, 2 Nov 2005 19:16:30 +0000 (GMT) (envelope-from julian@elischer.org) Received: from a50.ironport.com (a50.ironport.com [63.251.108.112]) by mx1.FreeBSD.org (Postfix) with ESMTP id 17CD943D5F for ; Wed, 2 Nov 2005 19:16:23 +0000 (GMT) (envelope-from julian@elischer.org) Received: from unknown (HELO [10.251.23.117]) ([10.251.23.117]) by a50.ironport.com with ESMTP; 02 Nov 2005 11:09:38 -0800 X-IronPort-Anti-Spam-Filtered: true Message-ID: <43690EED.10703@elischer.org> Date: Wed, 02 Nov 2005 11:09:33 -0800 From: Julian Elischer User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.7.11) Gecko/20050727 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Dinesh Nair References: <4360B8EE.4070605@alphaque.com> <4360DD7B.20900@samsco.org> <4361044B.50807@alphaque.com> <20051027.205250.55834228.imp@bsdimp.com> <43690424.1040904@alphaque.com> In-Reply-To: <43690424.1040904@alphaque.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org Subject: Re: locking in a device driver 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: Wed, 02 Nov 2005 19:16:30 -0000 Dinesh Nair wrote: > > > On 10/28/05 10:52 M. Warner Losh said the following: > >> libc_r will block all other threads in the application while an ioctl >> executes. libpthread and libthr won't. I've had several bugs at work > > > so if the userland thread does an ioctl, and the the driver goes to > tsleep() when the ioctl is received, all other threads are also > blocked from executing, i.e wont be context switched to run ? in 4.x and earlier. a tsleep saves your spl level but re-enables the interrupts (from memory) when you re-awaken you are given your spl level again.. All other threads are allowed to run. lower level code (the interupt executed part is not allowed to ever sleep) > > is this behaviour only 4.x specific or is it also there in 5.x ?