[RFC] Some new generic device features.
Robert Watson
rwatson at FreeBSD.org
Sun Feb 3 01:33:29 PST 2008
On Fri, 1 Feb 2008, Maxim Zhuravlev wrote:
> 2008/1/31, Hans Petter Selasky <hselasky at c2i.net>:
>
>> 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
More information about the freebsd-arch
mailing list