From owner-freebsd-arch Sun Mar 18 0:12:41 2001 Delivered-To: freebsd-arch@freebsd.org Received: from moby.geekhouse.net (moby.geekhouse.net [64.81.6.36]) by hub.freebsd.org (Postfix) with ESMTP id 4DE8137B739 for ; Sun, 18 Mar 2001 00:12:35 -0800 (PST) (envelope-from jhb@FreeBSD.org) Received: from laptop.baldwin.cx (john@dhcp152.geekhouse.net [192.168.1.152]) by moby.geekhouse.net (8.11.0/8.9.3) with ESMTP id f2I8Ei192214; Sun, 18 Mar 2001 00:14:44 -0800 (PST) (envelope-from jhb@FreeBSD.org) Message-ID: X-Mailer: XFMail 1.4.0 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: Date: Sun, 18 Mar 2001 00:12:08 -0800 (PST) From: John Baldwin To: Bruce Evans Subject: Re: 'final' man pages Cc: arch@FreeBSD.org, Matthew Jacob Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On 18-Mar-01 Bruce Evans wrote: > On Sat, 17 Mar 2001, Matthew Jacob wrote: >> > > .Sh RETURN VALUES >> > > Returns a interrupt mask value that is to be later passed >> > state (masks and levels have very different >> > semantics >> > which should probably be opaque here; better >> > rename intrmask_t too) >> > > .Xr restore_intr 9 . >> > >> > It's not even clear that interrupt states can be restored in a nested >> > way. >> >> Yes. >> >> Bruce- the following paragrahph is really hard to parse. I *think* you're >> saying that we cannot guarantee nesting. That's a fair addition. Anything >> else? > > I think there is no problem with guaranteeing nesting in drivers if > drivers follow the rules, and this must be guaranteed so that drivers > don't have to worry about. The public interfaces that we are discussing > are mainly for drivers. If there is a problem with interrupt nesting, > then it is in the implementation of mutexes and/or ithread scheduling. > Whatever is used there need not be the same as the public interface. Actually, while *_intr() do prevent preemption, that is all they do. They do not serve to protect data, so most drivers should be using spin mutexes in these cases instead as spin mutexes both prevent preemption and protect data. If the driver just needs to prevent preemption, it can use *_intr(). If the driver just needs to protect data, it can use a sleep mutex. Basically, *_intr() should probably be used very little in a driver, except perhaps if they are used while holding a sleep lock that protects the data used in the critical section. Note, however, that *_intr() can not be used to protect data and thus are probably not suitable for most applications. -- John Baldwin -- http://www.FreeBSD.org/~jhb/ PGP Key: http://www.baldwin.cx/~john/pgpkey.asc "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message