On Mon, 1 Jul 2002 23:45:34 -0700 "Greg KH" <[EMAIL PROTECTED]> wrote:
> On Fri, Jun 28, 2002 at 04:47:57PM +0200, Soewono Effendi wrote: > > > > And I think there must be some locking to protect > > if (driver->owner) > > __MOD_INC_USE_COUNT(driver->owner); > > and > > if (driver->owner) > > __MOD_DEC_USE_COUNT(driver->owner); > > > > may be: > > lock_kernel(); > > if (driver->owner) > > __MOD_INC_USE_COUNT(driver->owner); > > unlock_kernel(); > > and > > lock_kernel(); > > if (driver->owner) > > __MOD_DEC_USE_COUNT(driver->owner); > > unlock_kernel(); > > > > > > > > The goal is just to minimize the kernel locking time as much as > > possible, with the cost of size, I admit that. > > > Why do you think that the BKL or any lock is needed around the test and > set functions? > Well, in SMP any consecutive operations, that depend on each other, are doomed to race. The following operations are not atomic, as I can understand. > > if (driver->owner) > > __MOD_INC_USE_COUNT(driver->owner); the same aplies hier: > > if (driver->owner) > > __MOD_DEC_USE_COUNT(driver->owner); Best regards -- >> S. Effendi SEffendi @ sysgo . de SYSGO Real-Time Solutions GmbH http://www.sysgo.de Am Pfaffenstein 14 Tel. +49 6136 99 48 0 55270 Klein-Winternheim - Germany Fax. +49 6136 99 48 10 ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ [EMAIL PROTECTED] To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel