Re: ARM: why smp_mb() is not needed in the "__mutex_fastpath_lock" and "__mutex_fastpath_unlock" functions

2012-07-13 Thread shan kang
Yes, a customer reported an issue to me. After my investigation, I found the problem may be the lack of "dmb" in mutex_lock and mutex_unlock functions. Moreover, the issue could be resolved after the "dmb" was added. 2012/7/13 Will Deacon : > On Fri, Jul 13, 2012 at 10:10:52AM +0100, shan kang

Re: ARM: why smp_mb() is not needed in the "__mutex_fastpath_lock" and "__mutex_fastpath_unlock" functions

2012-07-13 Thread Will Deacon
On Fri, Jul 13, 2012 at 10:10:52AM +0100, shan kang wrote: > For example, in the following scenario, Process2 may get the wrong value; > Process1: > mutex_lock(); > write data; (store operation) > mutex_unlock(); > > Process2: > mutex_lock(); > read data; (load operation) > mutex_unlock(); Yes,

Re: ARM: why smp_mb() is not needed in the "__mutex_fastpath_lock" and "__mutex_fastpath_unlock" functions

2012-07-13 Thread shan kang
For example, in the following scenario, Process2 may get the wrong value; Process1: mutex_lock(); write data; (store operation) mutex_unlock(); Process2: mutex_lock(); read data; (load operation) mutex_unlock(); Suppose Process1 gets the lock first, write data and unlock. If the store operation

Re: ARM: why smp_mb() is not needed in the "__mutex_fastpath_lock" and "__mutex_fastpath_unlock" functions

2012-07-13 Thread Li Haifeng
Hi Shan, 2012/7/12 shan kang : > Hello, >I wonder why smp_mb() is not needed in the "__mutex_fastpath_lock" > and "__mutex_fastpath_unlock" functions which are located in the > "arch/arm/include/asm/mutex.h"? >I think "dmb" instruction is necessary there. Why necessary? Could you explain

Re: ARM: why smp_mb() is not needed in the __mutex_fastpath_lock and __mutex_fastpath_unlock functions

2012-07-13 Thread Li Haifeng
Hi Shan, 2012/7/12 shan kang kangshan0...@gmail.com: Hello, I wonder why smp_mb() is not needed in the __mutex_fastpath_lock and __mutex_fastpath_unlock functions which are located in the arch/arm/include/asm/mutex.h? I think dmb instruction is necessary there. Why necessary? Could

Re: ARM: why smp_mb() is not needed in the __mutex_fastpath_lock and __mutex_fastpath_unlock functions

2012-07-13 Thread shan kang
For example, in the following scenario, Process2 may get the wrong value; Process1: mutex_lock(lock); write data; (store operation) mutex_unlock(lock); Process2: mutex_lock(lock); read data; (load operation) mutex_unlock(lock); Suppose Process1 gets the lock first, write data and unlock. If the

Re: ARM: why smp_mb() is not needed in the __mutex_fastpath_lock and __mutex_fastpath_unlock functions

2012-07-13 Thread Will Deacon
On Fri, Jul 13, 2012 at 10:10:52AM +0100, shan kang wrote: For example, in the following scenario, Process2 may get the wrong value; Process1: mutex_lock(lock); write data; (store operation) mutex_unlock(lock); Process2: mutex_lock(lock); read data; (load operation) mutex_unlock(lock);

Re: ARM: why smp_mb() is not needed in the __mutex_fastpath_lock and __mutex_fastpath_unlock functions

2012-07-13 Thread shan kang
Yes, a customer reported an issue to me. After my investigation, I found the problem may be the lack of dmb in mutex_lock and mutex_unlock functions. Moreover, the issue could be resolved after the dmb was added. 2012/7/13 Will Deacon will.dea...@arm.com: On Fri, Jul 13, 2012 at 10:10:52AM

ARM: why smp_mb() is not needed in the "__mutex_fastpath_lock" and "__mutex_fastpath_unlock" functions

2012-07-11 Thread shan kang
Hello, I wonder why smp_mb() is not needed in the "__mutex_fastpath_lock" and "__mutex_fastpath_unlock" functions which are located in the "arch/arm/include/asm/mutex.h"? I think "dmb" instruction is necessary there. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel"

ARM: why smp_mb() is not needed in the __mutex_fastpath_lock and __mutex_fastpath_unlock functions

2012-07-11 Thread shan kang
Hello, I wonder why smp_mb() is not needed in the __mutex_fastpath_lock and __mutex_fastpath_unlock functions which are located in the arch/arm/include/asm/mutex.h? I think dmb instruction is necessary there. -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the