> > > Yes, if you don't like using the BKL (and I admit that it was a fun
> > > hack for me to use it), just have a static semaphore in your driver for
> > > all devices.
> >
> > Using the BKL for new code is not recommanded,
>
> Says who?

(from lib/kernel_lock.c)

/*
 * The 'big kernel semaphore'
 *
 * This mutex is taken and released recursively by lock_kernel()
 * and unlock_kernel().  It is transparently dropped and reaquired
 * over schedule().  It is used to protect legacy code that hasn't
 * been migrated to a proper locking design yet.
 *
 * Note: code locked by this semaphore will only be serialized against
 * other code using the same locking facility. The code guarantees that
 * the task remains on the same CPU.
 *
 * Don't use in new code.
 */

(from http://www.linuxjournal.com/article/5833)

"These attributes of the BKL helped ease the introduction of SMP during the 
2.0 kernel series. Today, however, they should provide plenty of reason not 
to use the lock."

This is of course not my opinion, I'm merely copying information I found. My 
experience as a kernel developper doesn't allow me to criticize the BKL 
yet :-)

Laurent Pinchart


-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to