From owner-freebsd-arch@FreeBSD.ORG Tue May 21 19:02:11 2013 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 59C36462 for ; Tue, 21 May 2013 19:02:11 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) by mx1.freebsd.org (Postfix) with ESMTP id 2DE896DF for ; Tue, 21 May 2013 19:02:11 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 36AEDB948; Tue, 21 May 2013 15:02:09 -0400 (EDT) From: John Baldwin To: Orit Moskovich Subject: Re: FreeBSD spinlock - compatibility layer Date: Tue, 21 May 2013 12:20:16 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p25; KDE/4.5.5; amd64; ; ) References: <981733489AB3BD4DB24B48340F53E0A55B0CFD79@MTLDAG01.mtl.com> <201305200950.26834.jhb@freebsd.org> <981733489AB3BD4DB24B48340F53E0A55B0D091F@MTLDAG01.mtl.com> In-Reply-To: <981733489AB3BD4DB24B48340F53E0A55B0D091F@MTLDAG01.mtl.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201305211220.16776.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Tue, 21 May 2013 15:02:09 -0400 (EDT) Cc: "freebsd-arch@freebsd.org" X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 May 2013 19:02:11 -0000 On Tuesday, May 21, 2013 12:36:38 am Orit Moskovich wrote: > That's not the case when using taskqueues for deferring execution of an interrupt handler. > Tasks can be delayed using the global taskqueue taskqueue_swi, which executes its tasks in the context of an interrupt. > In this case sleep is forbidden, and using spin mutex is not (although might be not recommended). No, swi's run in an interrupt thread, and interrupt threads can use regular mutexes. (That is why they run in a thread context.) The only way you can run in a context requiring a spin lock in a driver is to use an interrupt filter. -- John Baldwin