Volatile vs Non-Volatile Spin Locks on SMP.

2005-07-15 Thread multisyncfe991
Hello, By using volatile keyword for spin lock defined by in spinlock_t, it seems Linux choose to always reload the value of spin locks from cache instead of using the content from registers. This may be helpful for synchronization between multithreads in a single CPU. I use two Xeon cpus

Volatile vs Non-Volatile Spin Locks on SMP.

2005-07-15 Thread multisyncfe991
Hello, By using volatile keyword for spin lock defined by in spinlock_t, it seems Linux choose to always reload the value of spin locks from cache instead of using the content from registers. This may be helpful for synchronization between multithreads in a single CPU. I use two Xeon cpus

Re: About a change to the implementation of spin lock in 2.6.12 kernel.

2005-07-14 Thread multisyncfe991
Hi Willy, I think at least I can remove the LOCK instruction when the lock is already held by someone else and enter the spinning wait directly, right? 0: cmpb $0, slp jle 2f# lock is not available, then spinning directly without locking the bus 1: lock; decb

Re: About a change to the implementation of spin lock in 2.6.12 kernel.

2005-07-14 Thread multisyncfe991
Hi Willy, I think at least I can remove the LOCK instruction when the lock is already held by someone else and enter the spinning wait directly, right? 0: cmpb $0, slp jle 2f# lock is not available, then spinning directly without locking the bus 1: lock; decb