From owner-freebsd-hackers Thu Mar 30 16:03:36 1995 Return-Path: hackers-owner Received: (from majordom@localhost) by freefall.cdrom.com (8.6.10/8.6.6) id QAA03115 for hackers-outgoing; Thu, 30 Mar 1995 16:03:36 -0800 Received: from cs.weber.edu (cs.weber.edu [137.190.16.16]) by freefall.cdrom.com (8.6.10/8.6.6) with SMTP id QAA03109 for ; Thu, 30 Mar 1995 16:03:34 -0800 Received: by cs.weber.edu (4.1/SMI-4.1.1) id AA29610; Thu, 30 Mar 95 16:57:11 MST From: terry@cs.weber.edu (Terry Lambert) Message-Id: <9503302357.AA29610@cs.weber.edu> Subject: Re: help with splbio, splnet, spl... To: davidg@Root.COM Date: Thu, 30 Mar 95 16:57:10 MST Cc: vernick@cs.sunysb.edu, freebsd-hackers@FreeBSD.org In-Reply-To: <199503302344.PAA00262@corbin.Root.COM> from "David Greenman" at Mar 30, 95 03:44:02 pm X-Mailer: ELM [version 2.4dev PL52] Sender: hackers-owner@FreeBSD.org Precedence: bulk > > >Can someone point me to some documentation that explains how the spl > >interrupts work? For example, in the Scsi code (scsi_scsi_cmd in > >scsi_base.c) just before a command is sent to the adapter, a call is > >made to splbio(). Does this mask all I/O interrupts? Network interrupts > >too? > > It prevents interrupts from devices that are "bio" type. This is basically > all disk controllers. Tty devices (such as serial ports) are blocked with > spltty(). Network interrupts are blocked with splimp(). splhigh() and > splclock() block all interrupts except "fast" interrupts. "fast" interrupts > are special and can be explained if necessary; they are currently only used in > the sio driver. Or more simply: increasing priority ^ | fast ---------------------------------------------------> | | splclock -------------------------------------> | | ,---------' | splimp -----------------------------> | | ,---------' | spltty -------------------> | | ,---------' | splbio ---------> | B L O C K E D | | +--------------------------------------------------------- It's a tiered interrupt scheme. You can block all interrupts at or below a specified priority while you are doing high priority stuff so that it gets done in time. The "fast" interrupts can't be blocked. This way time critical stuff gets handled when it needs to be instead of being put off. For serial ports, since they have a limited queue depth, it's important to unload the queues "fast" because if you don't you can easily get a data overrun. I don't have the header files currently available or I'd have drawn a better (more comprehensive) picture. Terry Lambert terry@cs.weber.edu --- Any opinions in this posting are my own and not those of my present or previous employers.