On Mon, Apr 19, 2004 at 09:06:50AM +0200, Oliver Neukum wrote:
> Am Montag, 19. April 2004 04:55 schrieb Alan Stern:
> > On Sun, 18 Apr 2004, Oliver Neukum wrote:
> > > Am Sonntag, 18. April 2004 16:36 schrieb Alan Stern:
> > > > > A spinlock could replace it. But that is a small detail.
> > > >
> > > > Yes it could.  Then the driver would start to resemble its original
> > > > form again, defeating Greg's point.
> > >
> > > Where's the difference between
> > > lock_kernel();
> > > vs.
> > > spin_lock(&skel_open_lock);
> >
> > Ah, but if you use a spinlock (or semaphore) instead of lock_kernel() then
> > you have to lock _both_ the open() and disconnect() routines.  Otherwise
> > the lock won't do anything useful.
> 
> That's an advantage. Using the knowledge that sys_open() takes BKL in
> an example driver is not nice.

But it's a fact of life.  We need an external lock (from the internal
device structure) to prevent race conditions.  open() takes the BKL.
So, let's use that.  It's simple, nice, and it works.

I've also talked to the people responsible for the big "remove the BKL"
push during 2.5, and they can't think of any reason why they would want
to get rid of the BKL on open() as it never showed up on any of their
benchmarks.  They have also moved on to other things and say they never
want to try to clean that up again, so we are probably safe for a few
kernel release cycles :)

thanks,

greg k-h


-------------------------------------------------------
This SF.Net email is sponsored by: Oracle 10g
Get certified on the hottest thing ever to hit the market... Oracle 10g. 
Take an Oracle 10g class now, and we'll give you the exam FREE. 
http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to