From owner-freebsd-arch@FreeBSD.ORG Sun Feb 3 09:33:29 2008 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9740B16A41A for ; Sun, 3 Feb 2008 09:33:29 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [209.31.154.42]) by mx1.freebsd.org (Postfix) with ESMTP id 5449413C45D for ; Sun, 3 Feb 2008 09:33:29 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from fledge.watson.org (fledge.watson.org [209.31.154.41]) by cyrus.watson.org (Postfix) with ESMTP id A809646E07; Sun, 3 Feb 2008 04:33:28 -0500 (EST) Date: Sun, 3 Feb 2008 09:33:28 +0000 (GMT) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Maxim Zhuravlev In-Reply-To: Message-ID: <20080203093009.R28171@fledge.watson.org> References: <200801312135.48600.hselasky@c2i.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: freebsd-arch@freebsd.org, Hans Petter Selasky Subject: Re: [RFC] Some new generic device features. X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Feb 2008 09:33:29 -0000 On Fri, 1 Feb 2008, Maxim Zhuravlev wrote: > 2008/1/31, Hans Petter Selasky : > >> Some general comments: >> >> How does it handle mutexes? > > By now mutexes are used by io subsystem: All input/output requests (iors) > and queues of iors are guarded by spin mutexes. As for devices, their NewBus > sided structures will be guarded by (spin?) mutexes. Generic question: is it desirable/necessary to do this using [solely] spin mutexes? They are more expensive than regular mutexes (since they also disable interrupts), and are not generally necessary unless code is running under the scheduler or in a fast interrupt context. There are good reasons to write device driver code that runs in the fast interrupt context, but serious work (i.e., passing things up and down higher level stacks such as CAM, the network stack, ttys, etc) generally happens outside of that context. If some of this necessarily runs in those sensitive contexts, is it the case that it mostly does? Robert N M Watson Computer Laboratory University of Cambridge