Subject: Re: CVS commit: [itohy-usb1] src/sys/dev/usb
To: None <itohy@netbsd.org>
From: M. Warner Losh <imp@bsdimp.com>
List: source-changes
Date: 06/26/2007 21:57:36
In message: <200706270258.l5R2weMZ009506@v057181.ppp.asahi-net.or.jp>
            itohy@netbsd.org (ITOH Yasufumi) writes:
: imp@bsdimp.com writes:
: > The BSDs should just share one usbdevs.
: 
: s/usbdevs/usb stack/

Well, if we can't even agree on usbdevs, what hope is there for the
rest?

The two biggest differences between the systems are locking strategies
and device configuration.  These make it especially hard to share the
stacks.  The latter can be mostly papered over through the use of
macros, although at the cost of code readability.  The former is a
much tougher nut to crack.  FreeBSD's mutexes protect data, while
NetBSD splusb protects code.  The fine grain locking that's been
introduced into recent NetBSD versions might help change this, but it
took FreeBSD 5 years to lock down the kernel to the point where Giant
doesn't cover much these days.  As each of NetBSD's subsystems are
locked, I suspect different choices and strategies may be employed,
possibly learning from FreeBSD's and Linux's missteps, which might
make it awkward to share.

If there's a good way around these issues that I've not seen, I'm all
ears.

Warner